Objects eligible for garbage collection
Let’s break this down line by line: CardBoard c1 = new CardBoard(); We now have two objects, the CardBoard c1 points at and the Short c1.story. Neither is available for GC as c1 points at the CardBoard and the story variable of the CardBoard points at the Short… CardBoard c2 = new CardBoard(); Similar to … Read more