useexread1.java
来自「java基础教程以及代码 java base document and cod」· Java 代码 · 共 27 行
JAVA
27 行
// 异常演示 作除法
import java.io.*;
public class UseExRead1
{
public static void main(String [] args) throws IOException
{
try
{
BufferedReader key=new BufferedReader
(new InputStreamReader(System.in));
int a=Integer.parseInt(key.readLine());
int b=Integer.parseInt(key.readLine());
System.out.println(""+a+" / "+b+" = "+a/b);
}
catch (IOException ioeRef)
{
System.out.println(ioeRef.toString());
}
catch (Exception eRef)
{
System.out.println(eRef.toString());
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?