I have modified my question and hopefully putting on the correct place.
The Sierra's book tells: "WHEN searching for classfiles the javac and
java commands do not search the current directory by default."
I wanted to know whether this statement holds true only when we provide -classpath as option.
My understanding is as below:
Suppose we have a class A that extends another class B and both these files are in the same direcory /SRC.
When we invoke the following commands from the /SRC directory,it does not require the classpath to be set to current directory:
javac A.java
java A
Only when we put -classpath as option then we need to give current directory as the path to search as below:
javac -classpath . A.java
java -classpath . A
Please let me know if my understanding is correct.If the option classpath is not provided the current directory will always be searched for class files.
Regards,
Chandan