How many classes can you have in a Java program?

There can only be one public class top level class in a file. The class name of that public class should be the name of the file. It can have many public inner classes.

Leave a Reply

Your email address will not be published. Required fields are marked *