What's a main class? The main method must be declared public for access, but the class with the main method in may have package-private access as long as it is accessed from inside the same directory. [Probably also protected access if it is an inner class, but I have never tried.]
Classes should be declared public if access from outside their package is required. You can have as many public classes as you like, they only must be in their own files. If you search through JavaRanch, you will find more details, but it has to do with easier access to the code for the compiler.
subject: Query: When should the main class be declared as public & When should a class be declared as public?