Question :Does the code in finally block get executed if there is an exception and a
return statement in a catch block? (CoreJava)
Answer :If an exception occurs and there is a return statement in catch block, the
finally block is still executed. The finally block will not be executed when
the System.exit(1) statement is executed earlier or the system shut down
earlier or the memory is used up earlier before the thread goes to finally
block.
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Thursday, March 12, 2009
Does the code in finally block get executed if there is an exception and a
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment