• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 74025
332
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 74025
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried B?
 
Campbell Ritchie
Marshal
Posts: 74025
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic