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 the basically use of finally while we know it
is always executed but why?

Answers were Sorted based on User's Feedback



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

Answer / reshma

Using finally one can close the resources such as file
handler or a database connection. It ia good to maintain
the internal state of an object.

Is This Answer Correct ?    13 Yes 2 No

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

Answer / muffy.jad@gmail.com

The finally block is used to ensure resources are recovered
regardless of any problems that may occur.

finally is important because it allows the programmer to
guarantee the release of memory regardless of what happens
in the try block

finally is necessary when you need to set something other
than memory back to its original state.

Is This Answer Correct ?    11 Yes 0 No

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

Answer / sivadasan

Finally block always execute, its not consider whether an
exception is raised or not. Once try block is executed
means finally will be executed.

Finally block is necessary, often sufficient to execute
some important things its nothing but connection close
stmt..

system.exit(0); given in try catch block means finally
block will not be executed.

Is This Answer Correct ?    4 Yes 0 No

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

Answer / 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

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

Answer / guest

it is must after a try statement

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Core Java Interview Questions

What collections you have worked on? Internal working of Hashmap?

1 Answers   Bravura Solutions,


What is a instance variable in java?

0 Answers  


How do you declare an array that will hold more than 64KB of data?

0 Answers   Aspire, Infogain,


How many types of modifiers are there?

1 Answers   Infosys,


I have 100 records in a table with two rows. I need to display 10 records per page like Google Search. I need only the Logic(Pagination) in Pure Java. No JSP and all..Thanks in Advance...

2 Answers   Cybernet,


How will you measure that int takes up only 32 bits in memory?

2 Answers   Rolta,


What do you understand by final value?

0 Answers  


If a variable is declared as private, where may the variable be accessed?

0 Answers  


Which package is always imported by default?

0 Answers  


class A{ m2(){ } } class B extends A{ m2(){ } } class c extends B{ m2(){ } } class my_class extends c{ m2(){ } pulic static void main(){ ...My_class a = new my_class(); super.super.super.m2(); is this is leagal if not find what is the legal procedure in order to call A's version of m2(); }

8 Answers   Logica CMG,


Can you inherit a constructor java?

0 Answers  


What is lambda in java?

0 Answers  


Categories