The Java submission guidelines say:
However, I tried submitting some problems with Main being public and got AC.Do not use public classes (even Main must be non public to avoid compile error). However, you can add and instance as many classes as needed.