此处是包。
package error.test;
public class MyError extends Exception {
public MyError(String ErrorMessage){
super(ErrorMessage);
}
}
import error.test.MyError;
public class ErrorTest {
// public static void main(String[] args) {
// try {
// int age = Integer.parseInt("20 L");
// System.out.println(age);
// }catch (Exception e) {
// System.out.println("出现错误啦");
e.printStackTrace();
// } finally {
// System.out.println("请处理错误");
// }
// }
static int avg(int num1, int num2) throws MyError{
if(num1
关注
打赏