1.QA6
class Ex1 extends Exception {}
class Ex2 extends Ex1 {}
class QA11_6{
public static void main(String [] args){
String str ="";
int i=2;
try{
try{
switch(i){
case 1:throw new Ex1();
case 2:throw new Ex2();
case 3:throw new Exception();
}
str +="a";
}
catch(Ex2 e){
str +="b";
}
finally{
if(i
throw new Exception();
str +="c";
}
}
catch(Exception e){
str +="d";
}
finally{
str +="e";
}
System.out.println(str);
}
}
2.
class QA11_7{
public static void main(String [] args){
try{
m();
}
catch(Throwable e){
//System.exit(0);
}
finally{
System.out.println("In finally");
}
}
static void m() throws Throwable{
throw new Error();
}
}
3.
留言列表