posted 16 years ago
"
this code should right away give error when throwing ex in inner catch block exception not handeled.
how does above code prints catchfinally1finally2 .it goes fine when i un comment line 1
"
I am not sure whether I understood the question, but it goes to finally block before throwing the exception. If you have the exit uncommented, it won't throw exception because it exits execution before throwing.
try {
throw new RuntimeException();
}finally {
System.out.println("Finally");
}
That one also prints finally before throwing exception.