Hi All,
I apologise if this has been asked and answered previously but I haven't been able to find an existing forum answer to such a question.
I have the following structure
C:\a\A.java
C:\b\B.java
I compile these source files and the following structure results;
C:\a\A.class
C:\b\B.class
The A class creates an instance of B then calls B and B prints out "B"
I run the program as follows;
All fine and well. It works as expected. Then I decided to play around with the -classpath option as follows;
All fine and well. It works as expected. Then I run;
An exception is thrown. No problem, this is expected. I then run;
This is my question, why does this run? I have used the same classpath C:\f; but this time I have placed a ";" at the end of the classpath. I have not placed a period "." after the ";" to denote the current directory as part of the classpath. Sun states that;
The default class path is the current directory. Setting the CLASSPATH variable or using the -classpath command-line option overrides that default, so if you want to include the current directory in the search path, you must include "." in the new settings.
I haven't included the "." in my classpath but for some reason my classes are being found. Am I missing something here. Does the ".' automatically get appended to the classpath if the classpath ends in ";".
Any assistance will be greatly appreciated.
Thanks