When developing internal projects or individual modules (Non-public modules), the use of the modifiers on access rights may not be very noticeable, but access modifiers are important in the writing of public code or the development of an SDK class. The following is an understanding of public,protected,default,private, providing a way to:
1. If it involves the invocation of business logic between packages, consider public cosmetic classes, attributes.
2. Consider using the protected modification if it involves calls between classes under the package or if you need to provide a business method that inherits replication extensions.
3. If you want to use only the same package and do not want to inherit the replication, we consider default defaults (not write modifiers).
4. If you want to call only within a class, you can use private.
PS: The use of access modifiers should be based on the function of the code