Originally posted by Naseem Khan:
Well the answer for this question is one. See the K&B errata section and modify this question. When you modify your question, then objects eligible for GC will be two.
Right from start to end of your program, is c3 pointing to any object? It is always null. So there is no question about gc of c3 object.
cb is set to null. Fine but you must see that both cb and c2 are pointing to same object, so even cb is set to null, still this will not allow CardBoard object for GC as it is still referenced by c2.