Hi
I am first time posting a doubt , i searched for this question but found no post for this
I have doubt regarding the below two questions :
Q-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? (Choose all that apply.)
Set the current directory to xcom then invoke
javac B.java
Set the current directory to xcom then invoke
javac -classpath . B.java
Set the current directory to test then invoke
javac -classpath . xcom/B.java
Set the current directory to test then invoke
javac -classpath xcom B.java
Set the current directory to test then invoke
javac -classpath xcom:. B.java
(Howcome C is true and B is false( what is the problem B option? ), Please anyone explain me.
Q-7)Given two files:
a=b.java
c_d.class
Are in the current directory, which command-line invocation(s) could complete without error? (Choose all that apply.)
java -Da=b c_d
java -D a=b c_d
javac -Da=b c_d
javac -D a=b c_d
For sure c and d are wrong as we are not allowed to use -D with javac command , i have no doubt regarding the correct answer which is (A).
Now the doubts are that
1)question is saying first one is file ? howcome such name ?
2)Using -D, java -Da=b c_d seems to be very wierd.
Please any one put some light on above also
I am beating my head
Thanks in advance.
Vishal