• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java OCA 8 Programmer I Study Guide: Chapter 1 Mock Assessment, Question #14  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I apologize if this has already been answered previously.

I saw on the "https://www.selikoff.net/java-oca-8-programmer-i-study-guide/" Errata section that the answer is still D, with the explanation, "#14 – The answer is correct. The explanation about case sensitivity applies to why C is wrong rather why B is wrong".

However, I am still able to compile on my Terminal answer B. On the test, I chose B & D. Thanks for any advice.
 
Marshal
Posts: 58823
179
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please post the whole question for those of us who don't have the book. If the book was on selikoff.net was in the Boyarsky and Selikoff book?
 
Jacob Hazelton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given the following class in the file /my/directory/named/A/Bird.java:
INSERT CODE HERE
public class Bird { }
Which of the following replaces INSERT CODE HERE if we compile from /my/directory?
(Choose all that 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;
G. Does not compile.

The answer is D, but I chose B & D, because I think I go B to compile from the command line in the directory  /my/directory.
 
Campbell Ritchie
Marshal
Posts: 58823
179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried B?
 
Campbell Ritchie
Marshal
Posts: 58823
179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this the right link for the errata? Which page number was it? I am beginning to think you are correct and you have found a new error.
 
Jacob Hazelton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the right link

I created a file structure, like in the example:

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

And then I navigated to /my/directory/ and ran the command javac /my/directory/named/A/Bird.java and it compiled.
I wasn't able to run the command javac Bird.java from /my/directory/ however, although it didn't work for the correct answer as well, B. package named.A.

Thanks for your help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!