• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Errata OCP Java SE 11 Programmer I Study Guide - Chapter 1 Review Question 16

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

Errata OCP Java SE 11 Programmer I Study Guide, in Chapter 1, in Review Question 16,

The answer is written as only D option. But it should be B, D, F.

B --> javac named\A\Bird.java compilation works
D --> javac named\A\Bird.java compilation works
F --> javac named\A\Bird.java compilation works

Could you possibly check it please?
 
Marshal
Posts: 72909
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please confirm that is the Boyarsky and Selikoff book.
Please provide more information for those of us who don't have the book.
 
ilkay Polat
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes this question is from the Boyarsky and Selikoff book.



Question: Suppose we have the following class in the file /my/directory/named/A/Bird.java

Which of the answer options replace the INSERT CODE HERE when added independently if we compile from /my/directory?

INSERT CODE HERE
public class Bird { }
 
Campbell Ritchie
Marshal
Posts: 72909
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm afraid I'm getting confused. All three answers you showed look the same to me.
 
ilkay Polat
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
B) package my.directory.named.A;
D) package named.A;
F) package A;
 
Campbell Ritchie
Marshal
Posts: 72909
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried it? I think you are right that you can enter all those package names.
 
ilkay Polat
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I have tried all of them. I think those 3 options are the answers.

 
ilkay Polat
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what do you think Jeanne Boyarsky?
 
author & internet detective
Posts: 40549
825
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
The intent was fr the most common option. I noted in the errata though since we did say choose "all"
 
Rancher
Posts: 129
15
Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne, I feel that this question is confusing, because the "javac" command only needs you to provide a path of the file. It really doesn't matter where you are or how the class declared its packages. It's unlike the "java" command which require you to be at the root of the project folder. Did you mean to test the "java" command in this question instead of "javac"?
 
Jeanne Boyarsky
author & internet detective
Posts: 40549
825
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
No. We were intending to test basic use of javac. Moot point now since command line javac isn't on the 819 exam!
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:No. We were intending to test basic use of javac. Moot point now since command line javac isn't on the 819 exam!



Apologies if this is mentioned somewhere else but can you please specify in detail which sections of your 815 book are not on the 819 exam anymore? I don't want to miss anything in my learning journey

Thank you very much!
 
Jeanne Boyarsky
author & internet detective
Posts: 40549
825
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OUr 819 page lists what you can skip studying. (It isn't much, but every little bit helps)
 
Ranch Hand
Posts: 119
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This is the question from Jeanne's OCP java SE 11 Programmer I book.
Question #14 in Chapter 1.

The question is:

Suppose we have the following class in the file /my/directory/named/A/Bird.java.
Which of the answer options replaces INSERT CODE  HERE when added independently if we compile from /my/directory? (Choose all the apply.)


A. package my.directory.named.a;
B. package my.directory.named.A;
C. package named.a;
D. package named.A;
E. package a;
F. package A;



------------------------------------------------------

I believe the answer should be all the options A, B, C, D, E, and F.
I can use EITHER/ANY one of the packages and compile successfully under the /my/directory.
When compiling, it doesn't matter what the package name that Bird.java has.

See below:

/my/directory/     javac named/A/Bird.java














 
Campbell Ritchie
Marshal
Posts: 72909
330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HL, please show us what instructions you used to compile those files.
 
henry leu
Ranch Hand
Posts: 119
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:HL, please show us what instructions you used to compile those files.



The instruction that I used is:

calling  javac named/A/Bird.java

under the directory /my/directory
 
Jeanne Boyarsky
author & internet detective
Posts: 40549
825
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
The question is intended to address common convetions.

Also note that compiling regular classes at the command line is not on the 819. Compiling modules still is.
 
My pie came with a little toothpic holding up this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic