I did not try to put all the files in the same folder. Because I have to work in different folders. Anyway, what I tried to do is I removed package test1; from the very first beginning of my code, then tried to compile and run again. It worked this time.
So there are lots of questions raised in my mind now. Even I removed the line "package test1;" from my code, what happened, then my code executed succesfully? What is the importance of putting "package test1;" at the beginning of the code then? Is there any configuration when you put the "package test1;" at the beginning then to execute the code without any problem?
--ugur<br />"Read,think, and ask. Learn the reason of living."
Developers use packages to organize source code, and compiled class files. As asif pointed out, the compiled classes need to be in a directory structure matching the declared packages. In order to use a class such as fubar.Foo, not only does the class Foo need to be in a directory called fubar, but the directory fubar needs to be locatable through the CLASSPATH, so the parent of fubar needs to be in the CLASSPATH.