package scjp;
public class Demo369 {
public static void main(String [] args){
Demo369 e = new Demo369();
e.trythis();
}
public void trythis(){
try{
System.out.println("1");
problem();
}catch (RuntimeException x){
System.out.println("2");
return;
}catch(Exception x){
System.out.println("3");
[size=large]//return; [/size]
}finally{
System.out.println("4");
}
System.out.println("5");
}
public void problem() throws Exception{
throw new Exception();
}
}
有return结果是
1
3
4
没有return 结果是
1
3
4
5
也就是说return没有截断finally