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.
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.