Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 9031
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
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic