I will tell you the concept behind this.
You can specify only 1 public class per 1 source file because JVM will search the main() definition in this class.
Suppose you were allowed to write 2 public class in one
java source file, then how will JVM knows which main() method to invoke from these two classes.
Moreover your public class name should be same as java source file name...
Let me know if you sill have any doubt.....