• 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:

Sybex 1Z0-815 study guide (Boyarsky & Selikoff) errors

 
Greenhorn
Posts: 22
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I started studying for the Java 11 OCP exam (part I) and I was going through the review questions for chapter 1. I came across question 14 (chapter 1, page 32), which sounds like this:


Which options are valid on the jar command without considering module options? (Choose all that apply.)
A. -c
B. -C
C. -cp
D. -d
E. -f
F. -p



The answer to the question states the following:

A, B, C, E. When creating a jar file, you use the options -cf or -cvf, making options A and E correct. The jar command allows the use of the classpath, making option C correct. It also allows the specification of a directory using -C, making option B correct. Options D and F are incorrect because -d and -p are used for modules.



I am a bit confused by the part in bold, because I did not remember seeing the classpath option as valid for jar. I've also checked the official documentation for jar and I did not find any reference to -cp (I think java -cp could be valid if -c stands for create and p for the module path, if I am not mistaken).

This looks like an error in the study guide, which means only A, B and E are correct. If this isn't the case, can someone please explain?

L.E. I've just seen it in the official errata, but it was at the bottom of the list. This is indeed an error.

Thank you!
 
Marshal
Posts: 78653
374
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please provide more details of the book, including authors. Is it Boyarsky and Selikoff? If so, please check here. The errata are there arranged by page number.
 
Adrian Pop
Greenhorn
Posts: 22
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Campbell,

Thank you!

Yes, this is Boyarsky & Selikoff. I was just checking the official errata a few minutes ago and found the answer, but it was right at the bottom of the list and I didn't see it the first time.

This is indeed an error in the book.

You can close the topic, thanks.
 
Campbell Ritchie
Marshal
Posts: 78653
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Adrian Pop wrote:. . . Thank you! . . .

That's a pleasure
Please click the button below to mark the question resolved.
 
Adrian Pop
Greenhorn
Posts: 22
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually no, don't close it yet please!  

I've edited my initial post, because I forgot to mention another error in the book, which I couldn't find in the errata either.

Thanks!
 
Adrian Pop
Greenhorn
Posts: 22
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Stephan,

I'm sorry. I am new so I wasn't sure how you guys do things here.

So, to get back to the topic:

I found another issue in chapter 2 page 51, in the paragraph right above the note.

The code snippet shown as example looks like this:


Then, the explanation states the following:

The answer variable is initialized in both branches of the if statement, so the compiler is perfectly happy. It knows that regardless of whether check is true or false, the value answer will be set to something before it is used. The otherAnswer variable is initialized but never used, but the compiler is equally as happy. Remember, the compiler is only concerned if you try to use uninitialized local variables; it doesn’t mind the ones you never use.



I've highlighted the faulty part. As I see it, the otherAnswer variable is not initialized, it is only declared.

I didn't see this in the errata either.
 
Campbell Ritchie
Marshal
Posts: 78653
374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Adrian Pop wrote:. . . the otherAnswer variable is not initialized, it is only declared . . .

I think that is correct. Please wait; Jeanne Boyarsky checks this forum regularly and you can get crdited for finding “new” errata.
 
Master Rancher
Posts: 4655
62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree, otherAnswer is never initialized in the code shown.  The book answer missed an "un" - it should be

The otherAnswer variable is uninitialized but never used, but the compiler is equally as happy.

 
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
Confirmed and added to the errata.

In addition to the standalone 815 and 816 study guides, our publisher is going to be printing a combined one. Which means we get to fix such errata in that! Thanks for contributing one, (And I've credited you on the errata page)
 
Adrian Pop
Greenhorn
Posts: 22
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne,

Thank you, I'm glad I could help!
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic