Dear Friends,
Suppose if I've a
Java source file say NitTest.java in
C:\jdk1.5.0\bin directory. I compile it like below:
C:\jdk1.5.0\bin>javac NitTest.java The NitTest.class file will be generated inside C:\jdk1.5.0\bin directory only by above command.
Now i give following command:
C:\jdk1.5.0\bin>java NitTest Hello Everyone !! So i got the output !!
My Question: On pg 768 of Kathy Sierra it is given:
"When searching for class files, the java and javac commands don't search the current directory by default. You must tell them to search there. The way to tell java or javac to search in the current directory is to add a dot (.) to the classpath:"
Now if that is true then how java was able to search NitTest.class in the current directory(C:\jdk1.5.0\bin)?
Please remove my confusion.
Thanks & Regards,
Nitin