There can be max one public class per
java file.
If there are two or more classes in a java file then name of java file and
public class should be same.
if there are two are more non public classes in java file
then there is no rule applied on naming on java file compare to class file.