Originally posted by Jeff Schuler: ... When "e3 = null;", does that set e3.e to null as well? If not why? ...
It does not set the e3.e reference to null. However, the object that e3.e is pointing to can no longer be reached, and this makes it eligible for garbage collection.
But there is a problem with this code. At runtime, it will throw a NullPointerException at the line e2.e = e1; At that point, e2 is already null, so e2 cannot be dereferenced to get to e2.e. [ July 28, 2007: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
Originally posted by Jeff Schuler: ... This question is referring to a question in K&B book chapter 3. It states that a single object is never eligible for GC even though there is one prior to the runtime exception.