問題:為啥都是拋出異常,大家都沒有處理異常,但是一個會執行一個不會執行???
②這個例子拋出異常后 System.out.println("執行"); ?會執行 public static void main(String[] args)throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("yyyy,MM,dd"); Date date1 = sdf.parse(strTime); System.out.println("執行"); } 問題:為啥都是拋出異常,大家都沒有處理異常,但是一個會執行一個不會執行???求教大神們
2018-01-22
①這個例子拋出異常后?System.out.println("執行");? 不會執行
public static void main(String[] args)throws Exception {
String str = null ;
int strLength = 0;
strLength = str.length();
System.out.println(strLength);
System.out.println("執行");
}