close

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<3)
       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.

arrow
arrow
    全站熱搜

    凝輝 發表在 痞客邦 留言(0) 人氣()