Can an object be garbage collected while it is still
reachable?
Answer Posted / sudheer
Garbage collector is a low priority thread. We cant order to delete an object. When the object has no references and object which are out of scope will be deleted by the garbage collector to free the memory. So when an object is reachable it cant be garbage collected.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Which is the best sorting technique in java?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
How many types of gc are there in java?
How many types of java are there?
If an object reference is set to null, will the garbage collector immediately free the memory held by that object?
What is merge sort in java?
State the difference between strings and arrays.
Explain numeric promotion?
How do you create a null object?
What are desktop procedures?
Is null function in java?
What state is a thread in when it is executing?
How to remove the trailing spaces from a string?
What is the difference between class & structure?
What is bean? Where it can be used?