Win a copy of Spark in Action this week in the Open Source Projects 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Errata for OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide - page 265

 
Greenhorn
Posts: 12
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

Actually, I am using Adobe Digital Editions and page numbers are not same as erreta list, as I see.

In my version it is on 208, but when I check the errata list i think it should be 265; i think after table 5.7 in the fist two examples are inconsistent.

First example tells that java looks the default first, and then go through the requested in the getBundle method locale:

Locale.setDefault(new Locale("hi"));
ResourceBundle rb = ResourceBundle.getBundle("Zoo", new Locale("en"));
The answer is six. They are listed here:

1. Zoo_hi.java
2. Zoo_hi.properties
3. Zoo_en.java
4. Zoo_en.propertie
...


But second example tells the opposite; despite the visitor from Quebec, Java goes throug the requested one first. And program prints:
"Hello. Vancouver Zoo is open Canada visitor"

I think in the fisrt example the sorting should be changed as 3-4-1-2.

Or i could be misunderstood sth.

Thank you.
Aysenur.

 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aysenur,
Welcome to CodeRanch!

There's an important distinction here between the first resource bundle found and what will be used once one is found. See this thread which explains in detail.
 
Greenhorn
Posts: 8
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OCP 8 - Page 159 - Table 3.11

I read :

Table 3.11, column: computeIfAbsent and  row: Functional Interface used  ==> BiFunction. Few lines earlier in the example it is shown the computeIfAbsent() method taking a Funtion as parameter:    


and

I read :

Table 3.11, column: computeIfPresent and  row:Functional Interface used  ==> Function. Few lines earlier in the text it is written: "computeIfPresent() calls the BiFunction if the requested key is found"

 
Jeanne Boyarsky
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Charles,
You are correct. It's already noted in the errata (page 159).
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic