Hi Friends,
This is the question from our certification book. I am not getting the explanation given. Can any one help me out?
Answer: C
I felt the answer to be B. When I execute B option is say that class A not accessible.
---------------------------------------------------------------------------
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? (Choose all that apply.)
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 the current directory to test then invoke
javac -classpath xcom B.java
E. Set the current directory to test then invoke
javac -classpath xcom:. B.java