What do you know about the garbate collector ?

What do you know about the garbate collector ?

Garbage collector removes the unreferenced objects from heap memory.
By nulling the reference
By assigning a reference to another
By annonymous object etc.
The finalize() method is invoked each time before the object is garbage collected. This method can be used to perform cleanup processing. This method is defined in Object class as:
protected void finalize()

The gc() method is used to invoke the garbage collector to perform cleanup processing. The gc() is found in System and Runtime classes.

public static void gc()  

By:Sumit Tripathi
Date:2022-05-15 00:00:00

Post Your Answers

User Email:

User Name:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher