This question is from K&B Chapter 10, Question 5.
Given the default classpath:
/foo
And this directory structure:
foo
|
test |
xcom
|-- A.class
|-- B.java
And these two files:
package xcom;
public class A{}
package xcom;
public class B extends A {}
Which allows B.java to compile?
A. Set the current directory to xcom then invoke javac B.java
B. Set the current directory to xcom then invoke javac -classpath . B.java
C. Set the current directory to test then invoke javac -classpath . xcom/B.java
D. Set current directory to test then invoke javac -classpath xcom B.java
E. Set current directory to test then invoke javac -classpath xcom:. B.java
The answer is C.
But if we give -classpath . the test directory will be searched for the .class file.
The answer should be D.
Can anyone help me understand where I am going wrong?
thank you
[ September 02, 2008: Message edited by: Sirisha Ghatty ]