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"?
99 little bugs in the code, 99 little bugs in the code.
Take one down, patch it around, 117 little bugs in the code.
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
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.