Can an object be garbage collected while it is still
reachable?
Answers were Sorted based on User's Feedback
Answer / ravikiran(aptech mumbai)
yes...all the garbage ollection things depends on the
garbage collector of JVM
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / 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 |
Answer / janet
Once an object is garbage collected, it ceases to exist. It
can no longer become reachable again.
| Is This Answer Correct ? | 0 Yes | 3 No |
How do you identify independent and dependent variables?
Iterator in the HashMap is fail-safe means what?
What is mnemonic code?
What is thread pool in java with example?
What do you mean by inner class in java? Explain
What is Major and importance difference between for and foreach loop ?
What are format specifiers in java?
What does isempty () do in java?
Which class represents the socket that both the client and server use to communicate with each other?
What is the static method?
What will be the output of the program? public class Test { public static void main(String args[]) { ArrayList<String> list = new ArrayList<String>(); list.add("2"); list.add("3"); list.add("4"); list.add("5"); System.out.println("size :"+list.size()); for(int i=0;i<list.size();i++) { list.remove(i); } System.out.println("size after:"+list.size()); } }
what are ER diagrams?