-3
任何人都可以幫助我,當我執行這個程序時會發生什麼。爲什麼編譯器不能告訴編譯時異常?
它應該拋出編譯時錯誤,但它沒有給它。
public class Test {
public static void main(String args[]){
int c = getCount();
System.out.println(c);
}
private static int getCount() {
try{
throw new IOException();
}finally{
return 10;
}
}
在此先感謝!
'它應該拋出編譯時異常'。爲什麼? –
我的問題是'爲什麼?',你的回答是'是'。我很困惑。 –
什麼是「編譯時異常」。你的意思是「編譯時錯誤」? – Raedwald