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

 
 

SCJP Module-6 Question-30
Posted on: July 15, 2010 at 12:00 AM
The sample program given below will test your understanding of sequence of execution, of catch block in exception handling.

Given below the sample code :

1 try {
2 // code
3 } catch (NullPointerException ne) {
4 System.out.print("NullPointerException ");
5 } catch (RuntimeException re) {
6 System.out.print("RuntimeException ");
7 } finally {
8 System.out.print("END");
9 }

If NullPointerException is trown at line number 2, What will be the output of the above code?

1.Compilation error

2.NullPointerException .

3.NullPointerException  RuntimeException  END

4..NullPointerException  END

Answer

(4)

Related Tags for SCJP Module-6 Question-30:


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.