Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is “try and catch” in java

Answer Posted / lakshay gupta

The statements within the try block are executed, and if any
of them throws an exception, execution of the block is
discontinued and the exception is handled by the catch
block. There may be multiple catch blocks, in which case the
first block with an exception variable whose type matches
the type of the thrown exception is executed.
If no catch block matches the type of the thrown exception,
the execution of the outer block (or method) containing the
try ... catch statement is discontinued, and the exception
is passed up and outside the containing block (or method).
The exception is propagated upwards through the call stack
until a matching catch block is found within one of the
currently active methods. If the exception propagates all
the way up to the top-most main method without a matching
catch block being found, a textual description of the
exception is written to the standard output stream.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is flush () in java?

1004


what is server side caching?

2163


what is function overloading in java?

1288


Can we access the non-final local variable, inside the local inner class?

1015


Is there a jre for java 11?

1072


What is singleton class example?

1019


What is locale?

1021


What restrictions are placed on method overriding in java programming?

991


Define interface in java?

1071


What is the difference between Array and Hash Table?

1022


What is an association?

979


Which oo concept is achieved by using overloading and overriding?

1002


What is the purpose of garbage collection in java?

1090


Why do we declare a class static?

1141


What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?

1095