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 Java OCP 8 Programmer II Study Guide  RSS feed

 
Greenhorn
Posts: 1
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Chapter 4: Functional Programming. Checking functional Interfaces (Kindle Locations 6733-6734)
"Ready? Line 6 passes one String parameter to the lambda and returns a boolean. This tells us that it is a Predicate or Function."
but we have next line:
"6: _____< List > ex1 = x -> "". equals( x.get( 0));"
First - String class doesnt have get() method. Second - we have generic type List for functional interface.
So need to change String -> List and remove "or Function", because Function need to specify two generic types.

2. Chapter 4: Functional Programming. Creating Stream Sources (Kindle Location 6968)
"3: Stream < Integer > fromArray = Stream.of( 1, 2, 3);// count = 2"
count = 3

3. Chapter 5: Dates, Strings and Localization. Review Questions. Question 15. (Kindle Location 9805)
"System.out.println();"
Better will be to add _____ inside brackets.

4. Chapter 8: IO. Working with Streams. The FileInputStream and FileOutputStream Classes. (Kindle Location 13800)
"The FileInputStream class also contains overloaded versions of the read() method, which take a pointer to a byte array where the data is written. The method returns an integer value indicating how many bytes can be read into the byte array."
"can be read" should be "was read"

5. Appendix A: Answers to Review Questions. Answer for question 5. (Kindle Location 16220)
"C. Paths.get(new URI("cheetah.txt"))"
Paths.get throws "java.lang.IllegalArgumentException: Missing scheme", or add C to correct answers, or add scheme.
 
author
Posts: 4099
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help! See response below:

1. [page 181] This looks like a copy and paste error, should be List in the explanation, not String. Will add to errata.

2. [page 188] Already noted in errata http://www.selikoff.net/ocp

3. [page 281] This might be a Kindle issue, don't see this in the print copy.

4. [page 421] Wording typo noted. Will add to errata.

5. [page 570] Question #12 (not #5). This is fine as is. The question states "cannot" which in longer form means "cannot possibly work in any file system or standard JVM". In other words, which ones cause compiler errors. The error you listed is a runtime exception. It's possible the default file system (embedded in the Paths.get() method) could accept this value. For the exam, you are not required to know valid URI format.

Keep up the good word! We'll add your name to the errata page for 1 & 4!
 
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Added #1 and #4 to the errata. ("can be read" should be "were read" not "was read").

For #3, it is correct in the PDF we got that was the source of the Kindle copy too. So rendering error I guess. Neither of us has access to the Kindle version to confirm. If you can post a screenshot, I'll add it to the errata as e-book only.

And welcome to the Ranch. Have a cow!
 
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!