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

final keyword are assigned to 3 different things such as
(1)___to variables:
if the variable is declared as final then value to
that variable can be assigned only once.
(2)___to methods:
if the method is declared as final then method cannot
be overridden.
(3)___to class:
if class is declared as final then class cannot be
inherited.



if finally block is defined in the main() then the stmt
under it will be executed surely,but if the stmt
System.exit(0); is before finally block then it is not executed.



finalize():
finalize() method is called by the Garbage
Collector on an object when there is no more reference to
the object.
finalize() is never run more than once on any object.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of using enum to declare a constant?

1099


Why use string handling in Java?

1026


What does compareto () do in java?

992


Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..

2302


what is deadlock? : Java thread

1007


How do you find the independent variable?

1049


How do you sort an array in java?

990


What are disadvantages of java?

999


When is the finalize() called? What is the purpose of finalization?

1071


Why do we use string?

1038


Can inner class final?

1089


Where are local variables stored?

963


Is string thread safe in java?

1087


what is the final keyword denotes in java?

1085


make a method which any number and any type of argument and print sum of that arguments.....

1809