• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Sybex CSG 11, chapter 1, questions 14 and 16, possible wrong options on Answers to review questions

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, I hope you're doing well.

On the chapter 1, I guess the section "Answers to review questions" gave wrong for the questions 14 and 16.

For the question 14, it says the right options would be A, B, C and E.
But C doesn't work, once "-cp" has the short form "-c" (--create-file) and would provide also a "-p" that is an invalid argument for the "jar" command.

Regarding 16, it gives me a scenario where I have a file /my/directory/named/A/Bird.java, where my pwd would be /my/directory, and asks me possible package names in case I decided to compile that Bird.java file from the pwd.
Well, actually, with any of options 2(B), 4(D), 6(F) works fine, no compilation fail is raised when invoked;
$ (pwd /my/directory) javac named/A/Bird.java
But the "Answers to review questions" tells that for that question, the right option to be taken would be the 4(D).

Just for information, I'm reading that book (OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide) from Safari Books (https://learning.oreilly.com/library/view/ocp-oracle-certified/9781119619130/)

Warmest regards,
 
author & internet detective
Posts: 42056
926
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

Jean Villete wrote:For the question 14, it says the right options would be A, B, C and E.
But C doesn't work, once "-cp" has the short form "-c" (--create-file) and would provide also a "-p" that is an invalid argument for the "jar" command.


I agree that C is incorrect. This is already in the errata. Note that there are three errata lists.
Standalone 815 book
Standalone 816/817 book
Combined 819 book

The fact that you reported this error suggests you are using the standalone 815 book. And question 14 is in the errata for that (see page 493 in the errata table). When we printed the 819 Combined Study Guide, the 815 standalone had been out for a while. So we were able to fix all the errata that were reported at that time before printing the 819. The answer to question #14 was one of those. So it is correct in the combined CSP. At least it is in the printed one. It's possible Safari concatenated the two and called it the CSP part I or something.

Jean Villete wrote:Regarding 16, it gives me a scenario where I have a file /my/directory/named/A/Bird.java, where my pwd would be /my/directory, and asks me possible package names in case I decided to compile that Bird.java file from the pwd.
Well, actually, with any of options 2(B), 4(D), 6(F) works fine, no compilation fail is raised when invoked;
$ (pwd /my/directory) javac named/A/Bird.java
But the "Answers to review questions" tells that for that question, the right option to be taken would be the 4(D).


For #16, we are assuming the common directly placement.

Note: The 819 has a slightly smaller scope than the 815/816 did. In particular, the only command line content in scope is about modules.
 
What are you doing in my house? Get 'em tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic