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 comparable and comparator interface? List their differences
What are the drawbacks of singleton class?
When would you use a static class?
What is java command?
What are design patterns and please explain?
When should the method invokelater() be used?
What is byte code and why is it important to java’s use for internet programming?
What is nested loop? What is dangling else condition in it?
Is static a keyword in java?
What do you understand by Header linked List?
What is class forname used for?
What is string args [] in java?
What is the internal implementation of set in java?
Is null false in java?
what are the methods in object?