• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Possible mistake in the SCJP 6.0 Study Guide? - Please confirm

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

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?
A. 0
B. 1
C. 2
D. 3
E. 4
F. 5

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.
 
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you've fallen into the trap. Look at the difference between lines 3 and 4, and see if that changes your mind.
 
Faz Ali
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Matthew Brown wrote:I think you've fallen into the trap. Look at the difference between lines 3 and 4, and see if that changes your mind.



I see it now, can't believe I missed the static modifier. - It's like these questions are designed to be as tricky as possible!
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Faz,

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!

hth,

Bert
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Removed
 
reply
    Bookmark Topic Watch Topic
  • New Topic