What is the basically use of finally while we know it
is always executed but why?

Answer Posted / srinu

In finally block writing the code of clean up code i.e
means release the database connection,close the file.The
finally block complusary be executed block when ever
exception raised or not all ways execute this finally block

Note:
The following write statement write in try or catch block
it will not execute
System.error(0);

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is continuity of a function?

613


What is the applet security manager, and what does it provide?

644


What is difference between fail-fast and fail-safe?

689


What are the java ide’s?

678


who can i handle multiple client in RMI

1527






What are drawbacks of singleton class?

619


What is meant by interface?

638


How does the garbage collector works in java?

657


What is java’s garbage collected heap?

624


Should you use singleton pattern?

616


What is api in java?

631


What is bytecode in java ?

735


Is map sorted in java?

675


What are unchecked exceptions in java?

705


Which class is the superclass for every class in java programming?

662