Given:public class ExSuper extends Exception{
private final int eCode;
public ExSuper(int eCode,Throwable cause){
super(cause);
this.eCode=eCode;
}
public ExSuper(int eCode,String msg,Throwable cause){
super(msg,cause);
this.eCode=eCode;
}
public String getMessage(){
return this.eCode+": "+super.getMessage()+"-"+this.getCause().getMessage();
}
}
public class ExSub extends ExSuper{
public ExSub(int eCode,String msg,Throwable cause){
super(eCode,msg,cause);
}
}
and the code fragment:
try{
String param1="Oracle";
if(param1.equalsIgnoreCase("oracle")){
throw new ExSub(9001,"APPLICATION ERROR-9001",new
FileNotFoundException("MyFile.txt"));
}
throw new ExSuper(9001,new FileNotFoundException("MyFile.txt")); // Line 1
}catch(ExSuper ex){
System.out.println(ex.getMessage());
}
结果是什么?