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

How big is a 64 bit float?

0 Answers  


EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.

1 Answers   EDS,


Explain the difference between the Boolean & operator and the && operator?

1 Answers  


What java ide should I use?

0 Answers  


What is string example?

0 Answers  






How do you do math powers in java?

0 Answers  


is java support call by reference and call by value, if supports please explain?

5 Answers  


Why java does not support pointers?

0 Answers  


What is nested loop? What is dangling else condition in it?

0 Answers   Ericsson,


Is break statement can be used as labels in java?

0 Answers  


What programs use java?

0 Answers  


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

0 Answers  


Categories