try Java Keyword
The try is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java programming language likewise the try keyword indicates the following :
-- The try keyword in java programming language is used to
wrap the code in a block of statements where there are chances to get some
erroneous condition in form of an exception object.
-- Every try
block in java programming language must be followed by a one catch or finally
clause at least.
-- In exception handling mechanism, if an exception class is not handled by any catch
block, then that exception propagates up the call stack till it catches the
exception else it prints an appropriate error message.
Example to use the
try blocks:
try{ |
try{ catch
(Exception1 e){ |
try{ catch (<java.lang.Exception or subclass> e){
finally{ |