How is Garbage collection done in Java?
Answer Posted / harish
Garbage Collection is carried out based on the reference
type an object is currently in.
There are 4 types of references in java
1)strong reference
2)soft reference
3)weak reference
4)phantom reference
the last one is the weakest of the weak.
JVM will try get all those of object that are fell in this
category and try to collect it.
But it is not neccessary the object in phantom reference
phase will always be garbage collected.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is meant by structural programming?
Why does my function print none?
What is java lang string?
How do you sort in descending order in java using collections sort?
What is reverse function?
How to do a true java ping from windows?
What happens if an exception is not handled in a program?
Difference between process and thread?
What is the nested interface?
What is super in java?
What is factor r?
explain what is transient variable in java?
Explain list interface?
What is a boolean output?
What do you mean by local class?