Share on Google+Share on Google+

SCJP Module-6 Question-20

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) {
} catch (RuntimeException rte) {
} finally {

What will be the output of the above code ?

1. Compilation error

2. hello brothers

3 hello brothers and sisters

4.hello sisters.




Posted on: July 15, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial 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.