标签:逗号 int not found ati 语法 NPU 列表 sys ring
public class Main{
public static void readChar() throws IOException,RemoteException{
int input =System.in.read();
}
}
throw new ExceptionName("异常信息......");
throw new IOException("File not found.....");
try{
//可能出现异常的代码块
}catch(ExceptionName e){
// 出现异常后的处理方法
}
public class TestException5 {
// 第一种,当前不处理,继续往外面抛异常
public static void main(String[] args) throws Exception{
divide(2,0);
}
package chapter7_5;
/**
* @ClassName: TestException5
* @Author: mr.chen
* @Date:2021/2/16
* @Version: 1.0
**/
public class TestException5 {
// 第一种,当前不处理,继续往外面抛异常
public static void main(String[] args) throws Exception{
// 第二种,当地处理异常
// try {
// int result = divide(2, 0);
// System.out.println("result :" + result);
// } catch (Exception e) {
// System.out.println("出main异常了哟......");
// }
divide(2,0);
}
public static int divide(int num1, int num2) throws Exception {
try {
return num1 / num2;
} catch (Exception e) {
System.out.println("出异常了.......");
throw new Exception("异常了呀.......");
}
// return -1;
}
}
标签:逗号 int not found ati 语法 NPU 列表 sys ring
原文地址:https://www.cnblogs.com/mrchenyushen/p/15028227.html