answersLogoWhite

0

A try statement is used in conjunction with one or more catch blocks to provide exception handling. If an exception is thrown by a try block, the corresponding catch block will handle the exception. If no catch block is provided for a particular exception, then a runtime error occurs instead. Try-catch statements are used to provide graceful resolutions to potential runtime errors.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What do the initials CBF and CPP stand for?

CPP


What is the use of catch block in java?

the catch block catches the exception from the try block to display a proper message about the exception. Answered by, SOORAJ.M.S


Explain a program for this pointer in cpp?

Go to the link. You will got use of "this" keywork with simple explanation and example. http://cpp.codenewbie.com/articles/cpp/1527/Keyword_this-Page_5.html


When was CPP Group created?

CPP Group was created in 1980.


Will particular C program be compatible for both g c c and DEV Cpp compiler?

That is possible. Try it.


Why you use CPP in vinyl base ink for OPP substrate?

it gives adhesion on opp


What c plus plus program must be saved in a text with the extension cpp?

The .cpp extension is merely conventional; it is not required by the C++ standard. You can actually use any file extension you wish.


Why use catch keyword in java?

no, because catch is used to handle exceptions which are generated from try block


Why use throw in java in compare try-catch?

we use throws in our program so that we dont need to write try & catch block & to avoid the exception


Which is equivalent to try and finally block?

Try block is followed by finally block as an alternative . But usually it is followed by a catch block. Both are equivalent.


When was CPP Studios Event GmbH created?

CPP Studios Event GmbH was created in 1983.


How many finally block can be used for an exception handler?

Genaerally every try block maintain the one finally block or atleast one catch block or both. It mean try { try{ try{ } or } or } finally { catch(....) { catch(...){ } } } catch(.....) { : } finally{ : } Hear whenever we declar the try block without catch or finally bocks it show the compile time error like ' try without catch or finally' and also it is not possible to declare the any statements in between the try ,catch and finally blocks. ex: try{ } System.out.println("statement"); finally { } The above example show the compile time error 'try without catch or finally'. " Hear the finally block must be execute after excuting the try or catch block. Hence the finally block is used to release the resources like closing the streams and closing the jdbc connections." Hence in exception handling we use one finally block for one try block to release the resources.