1. If the class Yuangong is declared public, the class Yuangong must be saved in the name Yuangong . java files;
2, conversely, a file contains a maximum of a top-level public class, and the public class name is the same as the file name. For example, in file yuangong . Java, one or more classes are allowed to be defined, but a maximum of one top-level public class is allowed, and this class is named yuangong . The top-level emphasis here means allowing non-top-level public classes to exist, such as internal public classes.
simply put, there can be at most one class in a file that is public, so that you can expose the definition of a class and make it easier for other classes to access it! If you already have this public class, the file name must be the same as the class name! because of yourAbstractdemois already public modified, so remove the other two classes of public, save the file name is abstractdemo . Java
FileName. JAVA) can only match the name of the public class in the file