class CardBoard {
Short story = 200;// line A
CardBoard go(CardBoard cb) {
cb = null;
return cb;
}
public static void main(
String[] args) {
CardBoard c1 = new CardBoard();
CardBoard c2 = new CardBoard();
CardBoard c3 = c1.go(c2);
c1 = null;
// do Stuff
}
}
I extracted this question from Kathye Sierra book chapter 3
in the given sample answer it is said wrapper object (in line A) is also become eligible for garbage collection when execution reach //dostuff
please some one explain how does this wrapper object become eligible for GC