4. 3. Set the current directory to test then invoke
javac -classpath xcom/B.java
5. Set the current directory to test then invoke
javac -classpath xcom: . B.java
4. Set the current directory to
test then invoke
javac
-classpath xcom/B.java
It will not compile as it is incorrect syntax, as it has written nothing after -classpath.
5. Set the current directory to test then invoke
javac -classpath xcom: . B.java
See Abhi carefully why it will not compile. -classpath is used to search only .class files, means here it is only set to help B.java to find A.class file.
So -classpath is not used to search B.java, its ok.
Now we are in test directory and B.java is in xcom directory and we have not written xcom/B.java, so javac will try to find B.java in test directory, so it will fail to find B.java. that's it.
And now my humble request for you to make all the directory structure and run all the cases from command line, otherwise it will make you confused always.