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

 
 

Share on Google+Share on Google+
SCJP Module-6 Question-20
Posted on: July 15, 2010 at 12:00 AM
Advertisement
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)

Advertisement

Related Tags for SCJP Module-6 Question-20:


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
 

 

 

DMCA.com