The problem of the public type C must be defined in its own file occurs because the defined Java class is inconsistent with the file name 1. Change the file name to the same name as the public class
2. Change the class name to the same file name
3. When a subclass inherits a parent class, it does not need to modify it with public again