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

A "final" method or variable is one that can't be overridden
- you can define a method as final within a class to ensure
that any extensions to the class don't replace it.

If you add a "finally" block onto the end of a try / catch
exception handler, you're defining a block of code that will
be run if the try is entered, even if problems occur and
your method returns from within a catch rather than continuing.

A "finalize" method is your destructor method - code that's
run to clean up objects that are no longer required. For
example, objects which are memory cached would be flushed
back to the disc in your finalize.

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a finally block? Is there a case when finally will not execute?

1080


Can I declare class as static or private?

965


Write a program to reverse a number in java?

1092


What is the Concept of Encapsulation in OOPS

1000


what is an objects lock and which objects have locks? : Java thread

1020


What’s meant by anonymous class?

1087


How can we access some class in another class in java?

993


What are the parts of a method?

982


What methodology can be employed to locate substrings inside a string?

959


How do you insert a line break?

908


Explain jdk, jre and jvm?

976


What is null in java?

972


How do I compare two strings in word in java?

991


what is heap memory?

1100


What is the difference between an if statement and a switch statement?

1166