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


Share on Google+Share on Google+
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




Related Tags for SCJP Module-6 Question-30:

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 15, 2010

Recommend the tutorial

Advertisements Advertisements