想不到居然忘了如何自动抛出异常,汗,幸好有阿润帮忙,so record it。
public class A {
/**
* @param args
*/
public static void main(String[] args) {
try{
throw new NullPointerException();//此行会抛出NullPointedException
}
catch(NullPointerException e){
System.out.print("1");
}
catch(RuntimeException e){
System.out.print("2");
}
finally{
System.out.print("3");
}
}
}