Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javac question

 
Raphael Kou
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K&B Book Chapter 10 Question 5


Given deault classpath:
/foo

Directory structure:
foo
|
test
|
xcom
|--A.class
|--B.java

And these two files:

package xcom;
public class A {}

package xam
public class B extends A { }

So the only right answer is:
Set the current directory to "test" then invoke
javac -classpath . xcom/B.java

But this answer looks also right for me:
Set the current directory to "xcom" then invoke
javac -classpath . B.java

Why is this answer false?
 
dolly shah
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here

May be this link will help you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic