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.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote:Brian,
Welcome to CodeRanch! I've edited the subject of this thread to make it obvious which book the question is about.
That it is true. It goes beyond the scope of the exam though. It sounds like you have some (or a lot) of Java knowledge already. The OCA is a basic exam which means you are going to need to put aside some of that knowledge at times and pick the simplest answer.
Another way to think about is that the exam doesn't test knowledge about compiler options. It does test knowledge of package. So seeing a question like is a clue that the question is about packages.
On the real exam, you'll have another clue - the number of correct answers. If you see 4 possible correct answers and the exam asks you to choose 2, you should pick the most obvious/simplest two.
Brian James wrote:Yeah, I have a lot of Java experience, and I'm trying to bring my knowledge up to date with Java 8, and plan to take the OCA 8 and then OCP 8 exams now that my employer will pay for it. Thanks for the advice on the exam. I had read that it would specify the number of correct answers, which will help greatly. So I'll continue to keep that in mind as I go through chapter by chapter in the book.
Roel De Nijs wrote:Hi Brian James,
First of all, a warm welcome to CodeRanch!
Brian James wrote:Yeah, I have a lot of Java experience, and I'm trying to bring my knowledge up to date with Java 8, and plan to take the OCA 8 and then OCP 8 exams now that my employer will pay for it. Thanks for the advice on the exam. I had read that it would specify the number of correct answers, which will help greatly. So I'll continue to keep that in mind as I go through chapter by chapter in the book.
Having a lot of Java experience is not always an advantage when you prepare/take the OCA exam. Because as Jeanne said, it's an entry-level exam and focuses on the basics. But because you have much more experience and knowledge, and therefore assume/know things which could affect your answer (as this question showed).
In such a question it's very important to be aware of the "context of a question". This question only has answer options with package statements and in the question itself the directories where the Java source code file resides and from where the source code file will be compiled is the same, so it's clearly about choosing the most appropriate answer. In this thread you'll find a nice discussion about this "context of a question", it's definitely worth reading.
On the actual exam you know for each question how many correct answers you have to select. That's really helpful! Because you know how many answers to select, so if you have 1 obvious answer but the question states to select 2 you know you need to select another one (which you otherwise probably not would have selected). When I took the OCA7 exam, I even had to select an answer with a compiler error because all other answers were definitely incorrect!
Hope it helps!
Kind regards,
Roel
Brian James wrote:I know a great deal of it already, but honestly I'm a terrible test taker under pressure. So I'll be doing all the practice exams, and making sure I ask about questions like these when I don't have a high degree of certainty.
To avoid criticism do nothing, say nothing, be nothing. -Elbert Hubbard. Please critique this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|