A public class must have the same name as the source file. A non public class can have any name.
This is true only when you compile them with JDK in command.
And, moreover, in Eclipse, you must make the names the same even you dont specify public modifier.