• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Errata for Java OCP 8 Programmer II Study Guide

 
Greenhorn
Posts: 1
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41763
887
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
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!
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic