• 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
  • Tim Cooke
  • paul wheaton
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
  • Himai Minh
Bartenders:

[Sybex][possible errata] OCP 11 Programmer I Study Guide, p. LIII, Intro, question 11

 
Ranch Hand
Posts: 34
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In the explanation it is written:

(...) it is implicitly cast to a short, (...)


I think it should be

(...) it is explicitly cast to a short, (...)



Cheers,
Tomasz
 
Marshal
Posts: 77577
372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welome to the Ranch Please supply more details so those of us who don't have the book can understand the question better.
 
Tomasz Kasprzyk
Ranch Hand
Posts: 34
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The 11th question of the assessment test:

Which of the following expressions compile without error? (Choose all that apply.)
A. int monday = 3 + 2.0;
B. double tuesday = 5_6L;
C. boolean wednesday = 1 > 2 ? !true;
D. short thursday = (short)Integer.MAX_VALUE;
E. long friday = 8.0L;
F. var saturday = 2_.0;
G. None of the above



And the fragment of the explanation for answer D. (with the proposed correction):

Option D is correct. Even though the int value is larger than a short, it is implicitly explicitly cast to a short.

 
Campbell Ritchie
Marshal
Posts: 77577
372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the information; “explicitly” is correct. Please wait for Jeanne Boyarsky to see your post and look here; that doesn't appear to hae been noticed before.
 
author & internet detective
Posts: 41593
883
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Confirmed and added to the errata. Good catch!
 
Seriously? That's what you're going with? I prefer this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic