I don't think the specification says that the class has to be Public.
Refer to the examples on the official java tutorial. None of the classes with main method in the examples are declared as Public.
This was discussed previously on stackoverflow. Refer: Package-private class within a .java file - why is it accessible?
Explains it well.