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 life-cycle of an object?

Answer Posted / chantiraji

Object creation
---------------
The operator new allocates storage in the heap and invokes a constructor method for initialization of the object.

Object deletion
---------------
The Java garbage collector runs in parallel (as a thread) with the executing program, so garbage collection is in some sense continuous in Java. A class can have a finalize method that is to be invoked (automatically) before deleting an object. This is useful in case there are any resources, such as an open file, that need to be released by the object before it is removed from the system.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What's a method in programming?

1073


What are constructors in java?

1107


Differentiate between class and structure.

1132


Does java have extension methods?

975


What is the size of arraylist in java?

1026


What is :: operator in java 8?

1021


what is the purpose of "virtual"?

1085


Why does java not allow multiple public classes in a java file ?

4531


What is a flag value?

1021


Why do we use bufferedreader?

1001


What exceptions occur during serialization?

1084


What are the ways to instantiate the class class?

1102


What is the difference between jvm and jre? What is an interface?

1097


What is string value?

1163


What is use of set in java?

998