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
When can an object reference be cast to an interface reference in java programming?
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.
What is the significance of java packages?
What is difference between core java and java ee?
Explain about anonymous inner classes ?
Explain the available thread states in a high-level?
how to open and edit XML file in Weblogic???
What are different types of expressions?
What are the two main uses of volatile in Java?
What is passing value java?
What is the difference between Java1.4 and Java1.5
How many types of gc are there in java?
Is array size fixed in java?
Explain methods specific to list interface?
What are the restrictions imposed by a Security Manager on Applets?.