Home Tutorial Java Scjp Part6 SCJP Module-6 Question-20

 
 

SCJP Module-6 Question-20
Posted on: July 15, 2010 at 12:00 AM
The program given below will check your understanding of how to caught Exceptions in sequence in Exception Handling in Java.

Given below the sample code :

try {
// code
} catch (NullPointerException npe) {
System.out.print("hello");
} catch (RuntimeException rte) {
System.out.print("brothers");
} finally {
System.out.print("sisters");
}

What will be the output of the above code ?

1. Compilation error

2. hello brothers

3 hello brothers and sisters

4.hello sisters.

Answer

(4)

Related Tags for SCJP Module-6 Question-20:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.