Win a copy of High Performance Python for Data Analytics this week in the Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Errata for OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide - Chapter 5

 
Ranch Hand
Posts: 238
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Page 238, second paragraph:

These three times are all different but within a minute of each other.



The difference between time1 and time2 is 30 seconds, and the difference between time2 and time3 is 0.0000002 seconds (or 200 nanoseconds).
 
T Vergilio
Ranch Hand
Posts: 238
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And on page 249, there are two instances where it says

UnsupportedTemporalException



They should be

UnsupportedTemporalTypeException

 
T Vergilio
Ranch Hand
Posts: 238
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question about table 5.8 on page 265.

The table is saying that if the matching resource bundle is Zoo_fr.properties, then file keys can come from Zoo_fr.properties (the exact match) and Zoo.properties (the default properties file).

But it can also come from Zoo.java. Plus, if Zoo.java exists, Zoo.properties gets hidden by it and keys that are present in Zoo.properties, but not in Zoo.java, can't be accessed.

Let me illustrate the issue with a bit of code:




 
T Vergilio
Ranch Hand
Posts: 238
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I hide Zoo.java by putting it in a different package, then Zoo.properties gets accessed and "only I have this key" gets printed.

The conclusion I got to was: after a resource bundle is retrieved, the keys can come from more generic files up the hierarchy, with .java files taking precedence. However, if a .java file is used, the .properties file with the same name cannot be used. Is this correct?
 
author & internet detective
Posts: 40400
821
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

T Vergilio wrote:The difference between time1 and time2 is 30 seconds, and the difference between time2 and time3 is 0.0000002 seconds (or 200 nanoseconds).


Right. Which are all within a minute of each other. What's wrong here? 30 seconds is less than a minute. 200 nanos is way less than a minute.

T Vergilio wrote:And on page 249


Agreed and logged
 
Jeanne Boyarsky
author & internet detective
Posts: 40400
821
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

T Vergilio wrote:The conclusion I got to was: after a resource bundle is retrieved, the keys can come from more generic files up the hierarchy, with .java files taking precedence. However, if a .java file is used, the .properties file with the same name cannot be used. Is this correct?


Exactly! That list/table is to help you remember the order Java looks for things UNTIL it finds a property that it can use.
 
T Vergilio
Ranch Hand
Posts: 238
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

T Vergilio wrote:The difference between time1 and time2 is 30 seconds, and the difference between time2 and time3 is 0.0000002 seconds (or 200 nanoseconds).


Right. Which are all within a minute of each other. What's wrong here? 30 seconds is less than a minute. 200 nanos is way less than a minute.


You're right, I read that wrong. Sorry about that, tired brain!
 
Jeanne Boyarsky
author & internet detective
Posts: 40400
821
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

T Vergilio wrote:You're right, I read that wrong. Sorry about that, tired brain!


No worries. Forums are good for clarifying things!
 
T Vergilio
Ranch Hand
Posts: 238
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 248,

Duration doesn't have a constructor that takes multiple units like Period does.


should be

Duration doesn't have a factory method that takes multiple units like Period does.

 
Jeanne Boyarsky
author & internet detective
Posts: 40400
821
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

T Vergilio wrote:On page 248,

Duration doesn't have a constructor that takes multiple units like Period does.


should be

Duration doesn't have a factory method that takes multiple units like Period does.


Confirmed. Duration and Period don't have public constructors at all!
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
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