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...

Explain final, finalize() and finally?

Answer Posted / tarun

Any class declared by final cannot be subclassed.

Any variable declared with final its value remain constant
that is declared at the time of declaring it.

Any method declared with final in a class can not be
override with other class.

finalize() method is called by the Garbage Collector on an
object when there is no more reference to the object.

finally method is used in exception handling with try-catch
block. try block can not be used alone, it should be used at
least with catch or finally. In catch block we catch(handle)
the exception type that occured during the execution and in
finally we write some code like closing file, connection,
garbag collect any object that is of no more useful in our
application.

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the return statement?

1054


Can we override the static methods?

1033


Write code to implement bubble sort in java?

994


Why Java doesn’t support multiple inheritance?

1038


how many types of Inheritance?

1171


Explain the difference between abstraction and encapsulation.

978


What is float in java?

990


Write a program to search a number in the given list of numbers.

1031


What does it mean to flush a file?

1063


What does system out println () do?

1004


How does a for loop work?

988


Explain about collection interface in java?

991


What are some examples of variable costs?

955


What is the final method?

1073


Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

1156