hi all,
I found difficulties when I learn about classpath, it's really confusing. please find below example from my self code.
My directory structure as per below :
After several attempts, I have compiled and running above code and it was running well, here is the code :
compile Animal.java
compile Horse.java
running Horse.class
My question is why I have to specify the Animal class when I compiled and run the Horse? why I can't do it like this--> C:\Documents and Settings\Mila\Desktop\project>
java -cp .\com\path;. Horse (no Animal added, only the classpath for animal??)
So confusing, really appreciate for your reply.