-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