What is garbage collection in Java, and how can it be used ?
Answer Posted / rintu kumar kanp
Finding garbage and reclaiming memory allocated to it.
Garbage holds unreferenced objects
ex:-
Student ali= new Student();
Student khalid= new Student();
ali=khalid;
Now ali Object becomes a garbage,
It is unreferenced Object
it be used When the total memory allocated to a Java
program exceeds some threshold.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How many types of array are there?
give an example for encapsulation?
how can you take care of mutual exclusion using java threads? : Java thread
What is passing parameters in java?
What is the difference between import java.util.date and java .util?
What is the difference between this() and super() in java?
Why wait and notify methods are declared in object class?
Why java uses the concept of the string literal?
Can static method access instance variables ?
Is 0 true or is 1 true?
Why collection is called framework in java?
Difference between nested and inner classes ?
What about main() method in java ?
What are the advantages and disadvantages of reference counting in garbage collection?
What modifiers may be used with an inner class that is a member of an outer class in java programming?