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 are the differences between final,finally,finalize
methods?

Answer Posted / jayakrishnan.p

final is used for making a class no-subclassable, and making
a member variable as a constant which cannot be modified.
finally is usually used to release all the resources
utilized inside the try block. All the resources present in
the finalize method will be garbage collected whenever GC is
called. Though finally and finalize seem to be for a similar
task there is an interesting difference here.This is because
the code in finally block is guaranteed of execution
irrespective of occurrence of exception, while execution of
finalize is not guarenteed.finalize method is called by the
garbage collector on an object when the garbage collector
determines that there are no more references to the object.

Is This Answer Correct ?    168 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the collection interface?

971


Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?

980


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2756


What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?

1035


What all access modifiers are allowed for top class ?

1138


Write a method that will remove given character from the string?

960


What is the same as procedures?

926


Is null == null in java?

1034


How large is a boolean?

948


Difference between start() and run() method of thread class?

994


Is string serializable in java?

958


What are advantages of using Java?s layout managers than windowing systems?

2315


Is math class static in java?

1047


What does g mean in regex?

932


Which is better stringbuffer or stringbuilder?

869