Showing posts with label ArrayIndexOutOf Bounds. Show all posts
Showing posts with label ArrayIndexOutOf Bounds. Show all posts

Wednesday, 22 January 2014

NESTED try STATEMENT

NESTED try IN EXCEPTION HANDLING


Java:nested try-catch blocks with simple example

The try block within a try block is known as nested try block.Sometimes a situation may arise where a part of a block may cause one error and the entire block itself may cause another error. In such cases, exception handlers have to be nested, one within another. In java, this can be done using nested try blocks. A try statement can be inside the block of another try. In a nested try block, every time a try block is entered the context of that exception is pushed on the stack.