• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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: 41125
848
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.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic