you are setting classpath to . , so i think you being in xcom dir, you sould be able to use classes in xcom...
That's right, you're able to use CLASSES, not SOURCE FILES. A file B.java is a source file, classpath has nothing to do with it. For the javac compiler to find the source file, we have to either set the current directory to xcom (where B.java resides) or specify the full qualified name foo/test/xcom/B.java.
In D option we can see the standard way of specifying several directories in the classpath in Linux, using a colon ":". In Windows you use the semicolon ";" symbol. Though this option is incorrect anyway because we specify only the name of the file B.java, while in test directory. The compiler doesn't see the file, as B.java is in the xcom directory.