Description of the meanings of the access modifiers public, private, protecte, and default in Java:
Public (interface access permission): modifier with the widest access restriction in Java, which is generally called "public ". Classes, attributes, and Methods Modified by the package can be accessed not only across classes, but also across packages.
Private (you cannot access): the shortest modifier in Java, which is generally called "private ". The classes, attributes, and Methods Modified by the class can only be accessed by the objects of the class. The subclass of the class cannot be accessed, and cross-package access is not allowed.
Protected (inherited access permission): An access modifier between public and private. It is generally called a "protected form ". Classes, attributes, and Methods Modified by the class can only be accessed by methods and subclasses of the class, even if the subclass can be accessed in different packages.
Default (package access permission): it is usually called "default access mode" without any access modifier. In this mode, only access in the same package is allowed.
(Only in Java ......)