File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Ambigous questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Ambigous questions" Watch "Ambigous questions" New topic

Ambigous questions

yusuf Kaplan
Ranch Hand

Joined: Mar 11, 2011
Posts: 58
Hi all,

there is an ExamLab question on the diagnostic exam regarding javac look like this:

javac -d rabbit board/

One of the correct answers is "The output will be stored in the rabbit directoy".
But I choose "The output will be stored in the rabbit board directoy"

After some tests on the console I figured out that has no package. If the full qualified class name were like board/ then my answer would be correct. I assumed that board is the package name but it was not. has no package at all. Thus the class file is stored in rabbit directory.

How to deal with such missunderstandings? The question doesnt provide information whether has a package 'board' or not. So I feel that my answer might be correct as well.
Stephan van Hulst

Joined: Sep 20, 2010
Posts: 3573

The -d switch specifies the output directory. So here it says that the output directory will be rabbit. If A was in the package board, a sub-directory would be created inside the rabbit folder, but that doesn't change the fact that rabbit is the output directory of the javac command.
It is sorta covered in the JavaRanch Style Guide.
subject: Ambigous questions
Similar Threads
K&B - Practice Exams book - Full Exam II - Question 21
question and sample problem about classpath
javac in ant, please helppp
New SCJP 5.0 Free Exam Simulator
Compiling a file that has reference to a class contained in another UNCOMPILED file.