Ohh Sorry! I posted the structure wrongly . I am correcting it in the original post...
Joined: Sep 22, 2008
It is compiling now. I have another very basic question.
I had not written package statements in Robot, Pet and Dog class. They compiled fine but MyClass does not compile without package statements in those source files. Why are they necessary. Is it because we are using import in MyClass and to use a class in another package, we must mention package in the source file of class to be used. Please explain. I know its very basic but i want to understand it clearly.
You are right. Suppose there is a file MyClass in org/mysite folder. If you don't include package statement in the file, then the class will be in the default package. It will compile fine. But if you try to use the class as org.mysite.MyClass, you will get an error that there is no such class...