Why isn't there any compilation issue as Exception is never thrown in the Try block? Is it because somewhere in the System.out.println method there can be an Exception thrown?
If I modify the code like that :
Code: Select all
try{
amethod();
System.out.println("try");
}
catch(FileNotFoundException e){
System.out.println("catch");
}
finally {
System.out.println("finally");
}
System.out.println("out");
Thank you