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 matcher in java?
please send me hr interview questions in it industry
Why java is considered dynamic?
What is data movement?
Which is fastest collection in java?
What is passed by reference and pass by value ?
What is unsigned char?
How many digits is int32?
How do you use parseint in java?
What is the difference between procedural and object-oriented programs?
What are loops in java?
What do you understand by soft reference?
What is the difference between access specifiers and access modifiers in java?
What is jit compiler in java?
explain what is transient variable in java?