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 java ide should I use?
why Interface used?
What is super?
Explain the difference between comparator and comparable in java?
What is hash in java?
What is connection class in java?
How do I stop concurrentmodificationexception?
How do generics work in java?
What is a numeric format?
What are jee technologies?
How do you write a scanner class in java?
What lambda means?
What type of language is java?
What is the difference between form & report?
What are the restrictions imposed by a Security Manager on Applets?.