This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
Ranch Hand
Posts: 238
5
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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!
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!