• 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

OCP Study Guide - possible errata Ch7 Q17 (Sybex)

 
Greenhorn
Posts: 4
2
Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 7 - Questions 17 (pg 401) has the correct answer listed as B (pg 564) and claims the code compiles.  However, the import is for java.util.concurrent.*; which does not include AtomicInteger class from java.util.concurrent.atomic.  I believe the answer should be D but I could be missing something.  Thanks!
ch7-17.png
[Thumbnail for ch7-17.png]
AtomicInteger
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added the publisher to the thread title to make it obvious which book this is about.

You are correct it would should have had the import there. But it isn't an errata because we got lucky! After this book went to print, Oracle added verbiage to all their exams saying imports may or may not be provided. So a missing import is now implied on the exam.
 
Enthuware Software Support
Posts: 4803
52
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

You are correct it would should have had the import there. But it isn't an errata because we got lucky! After this book went to print, Oracle added verbiage to all their exams saying imports may or may not be provided. So a missing import is now implied on the exam.


I don't think that is the right interpretation of Oracle's assumption. You can assuming missing imports if there are no import statements. You cannot assume the existence of one missing import when the code listing contains import statements. Here is what they've specified:


If sample code do not include package or import statements, and the question does not explicitly refer to these missing statements, then assume that all sample code is in the same package, or import statements exist to support them.


Assuming the existence of one import statement when other import statements are present is bad advice. Specially when one of the options is "will not compile".

HTH,
Paul.
 
reply
    Bookmark Topic Watch Topic
  • New Topic