What is the life-cycle of an object?

Answers were Sorted based on User's Feedback



What is the life-cycle of an object?..

Answer / javamasque

The life cycle of an object starts with instantiation and ends with garbage collection

Is This Answer Correct ?    51 Yes 3 No

What is the life-cycle of an object?..

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

More Core Java Interview Questions

Can a static method be overridden in java?

0 Answers  


What best practices should you follow while writing multithreaded code in java?

0 Answers  


What is "finally" keyword?

10 Answers  


What are the restrictions imposed by a Security Manager on Applets?.

0 Answers  


Explain about anonymous inner classes ?

0 Answers  






What is the reason behind using constructors and destructors?

0 Answers   HCL,


What is the difference between Checked and Unchecked exception? Give some examples

2 Answers   Ness Technologies,


How many types of voids are there?

0 Answers  


program to find 25 square = 625 here the 625 of last two digits is equal to 25, i don't know excatly what this type of number is called

1 Answers   Huawei,


What is mvc in java?

0 Answers  


Difference between ‘is-a’ and ‘has-a’ relationship in java?

0 Answers  


What class of exceptions are generated by the java run-time system?

0 Answers  


Categories