The code compiles & runs because both these classes are in the same folder ( To be more correct both classes are added to the class path ). Try to put the other class some where else and add this class ( with the whole path ) to the class path , even then you should be able to run the program.
When we give a Package statement, we are logically grouping related classes to be in one folder. This is for code readability & for easy maintenance. [ October 13, 2005: Message edited by: Srinivasa Raghavan ]