What is the life-cycle of an object?
Answers were Sorted based on User's Feedback
The life cycle of an object starts with instantiation and ends with garbage collection
| Is This Answer Correct ? | 51 Yes | 3 No |
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 |
what are the major differences between jdk1.4 and jdk1.5?
2 Answers Cap Gemini, Crimson Logic, Infosys, TCS, Tenth Planet,
What is instance synchronization?
Define package in Java.
What is the main purpose of java?
Can we use catch statement for checked exceptions?
what is mean by method signature?
Why do we use predicate in java?
What are generic methods?
How finally used under exception handling?
What is the purpose of void class?
Name four container classes.
What is arraylist e?