Aryan PrajapatKnowledge Contributor
What are the possible ways of making objects eligible for garbage collection (GC) in Java?
What are the possible ways of making objects eligible for garbage collection (GC) in Java?
If a reference variable for an object is removed from the programme while it is running, the object may be trash collected. They are also referred to as inaccessible objects occasionally. The new operator returns a reference to an object after dynamically allocating memory for it.