Java 8 Exception Handling: Develop Reliable Java Applications (Black Book Series) by Mahavir DS Rathore

Java 8 Exception Handling: Develop Reliable Java Applications (Black Book Series) by Mahavir DS Rathore

Author:Mahavir DS Rathore
Language: eng
Format: mobi
Published: 2016-02-09T22:00:00+00:00


catch(Throwable e) {

System.out.println("The Throwable message is " + e);

}

}

}

This program will yield into an exception(ArrayIndexOutOfBoundsException) if command line argument in not passed.

Output:

Summary

From Java 7 onwards programmer can handle multiple exceptions in a single catch.

Chapter 9

Finally Block

Topics

 What is ‘Finally’ Block?

 Using ‘Finally’ Block.

 Advanced Try Block.

 Summary

What is ‘Finally’ Block?

It is placed after the catch block (only when the catch block exists). The finally block is executed if there is an exception and also when there is no exception. This make finally block confusing to use. A very important attribute of finally block is that it guaranteed to be executed except when it is abruptly terminated.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.