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
Is treeset sorted in java?
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
List the interfaces which extends collection interface?
Can we inherit a class with private constructor?
Is int primitive data type?
What is difference between jdk,jre and jvm?
What is static class
What is runtime polymorphism or dynamic method dispatch?
Is java util regex pattern thread safe?
explain different ways of using thread? : Java thread
Can you make a constructor final in Java?
Can a set contain duplicates?
what is thread? What are the high-level thread states? : Java thread
What is collections framework?
What is try-with-resources in java?