Which of the following statements are true?
1) The automatic garbage collection of the JVM prevents programs from ever running out of memory
2) A program can suggest that garbage collection be performed but not force it
3) Garbage collection is platform independent
4) An object becomes eligible for garbage collection when all references denoting it are set to null.
Answers: 2,4.
I think 4 is incorrect, because there might be a senario where objects A and B form an island referencing each other, but the active
thread does not reference either A/B.
Am I correct? Thanks.