In going through the self-test questions for chapter 3 and believe there is a mistake, in an answer to one question. Can you please confirm:
1. Question 11 (page 275)
When the code reaches '//do stuff', how many objects are eligible for garbage collection?
The book says the answer is 'B. 1' but i just don't see how. I think the answer is "C. 2" as both 'b1' and 'a1' no longer have any references to them, unless I am wrong?
Any clarification would be appreciated.
We often hear that the questions are designed to be tricky. Hmmm.
My experience on the job is that finding bugs can be tricky too
I like to think that exam questions and mock exam questions are tiny, little examples of stuff that you'll find in the real world. I mean, can't you just imagine working for a long time trying to figure out why your program keeps running out of memory, and then, wow! you find a static variable!
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)