My question is if B.class does not exist in the "two" directory, and we try to compile A.java that is in the "one" directory, would it also compile B.java that is in the "two" directory. I know it is senseless question.
We must compile B.java before we can compile A.java, because javac will search for B.class and not B.java.
We can do it in one line two like:
top>javac one/A.java two/B.java
italics is my doubt and bold is what it should be!
Joined: Aug 03, 2002
would it also compile B.java that is in the "two" directory?
Well, that's what it did! I certainly did not compile it.
Joined: Feb 28, 2007
I did the same, and it worked. B.class automatically created in "two" directory.
But if we give classpath (-cp) with javac, then what happens.