说14行出错了啊,谢谢啊,号码呢
class MyException extends Exception{
private int detail;
MyException( int a ){
detail=a;
}
public String toString(){
return "MyException "+detail;
}
}
public class ExceptionDemo1{
static void compute(int a) throws MyException{
System.out.println("调用compute("+a+")");
if(a>10)
throw new Exception(a);
System.out.println("这是正常退出");
}
public static void main(String args[]){
try{
compute(1);
compute(2);
}
catch(MyException e){
System.out.println("此处捕获了"+e);
}
}
}
class MyException extends Exception{
private int detail;
MyException( int a ){
detail=a;
}
public String toString(){
return "MyException "+detail;
}
}
public class ExceptionDemo1{
static void compute(int a) throws MyException{
System.out.println("调用compute("+a+")");
if(a>10)
throw new Exception(a);
System.out.println("这是正常退出");
}
public static void main(String args[]){
try{
compute(1);
compute(2);
}
catch(MyException e){
System.out.println("此处捕获了"+e);
}
}
}









