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 is Overriding and how can it be used?
What is clipping?
What is the difference between the file and randomaccessfile classes?
Is ResultSet class?
5 Answers Bally Technologies, TCS,
What is object-oriented programming?
Difference between interface and abstract class with ex.
4 Answers Cognizant, Tech Mahindra,
What is a newline character in java?
Nullpointer exception is a very common exception. Why is it not made as a checked exception?
what is polymorhism what is inheritance? what is Abstract n Interface? what if two interfaces have same method and a concrete class is implementing both the interfaces. Will there be a compilation error? What are mutable and immutable classes? How can u make a class mutable? when will u use dem ...explain with example? what is overriding and overloading? what is garbage collection? what is Thread? how do dey communicate? what are the different ways of implementing ? have u used any messaging technologies? what is synchronization? what are some additions in java 1.5? what are generics? whst is advanced for loop? what is finally block? can u have a try in finally? yes!! can u have a finally in finally? how do you write junits? when is a object eligible for garbage collection?explain? a = null and b has ref to a will b be eligible to be garbage collected? sql questions like diff joins? how do dey work? exception handling? what is marker interface? what is the need??
Can we extend singleton class in java?
What are sets in java?
What is numeric data type?