Hi fellows,
This class below was posted for a garbage collection topic but I'm having question related to this:
CODE] CardBoard {
Short story = 5;
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
}
} [/CODE]
So.. how many object are garbage collected after //do stuff?
c1 will be, so 1 object is for sure... but will "story" count also? Will "story" be garbaged collected? stay tuned ...
Thanks,
Valentin
[ November 11, 2006: Message edited by: Valentin Mone ]