Java internal class

xiaoxiao2021-03-06  63

Java internal class internal class properties

Class names can only be used in a defined range unless defined names.

The name of the internal class must be different from the nested class.

Internal classes can be defined in the method.

Any variable, whether local variables or formal parameters, if the variable is marked as Final, then it can be accessed by the method in the internal class.

The internal class can be defined as Abstract.

Internal classes can be declared as private or protected to protect them from access from external classes.

An internal class can be implemented as an interface and is implemented by another internal class.

Automatically declared the internal class of Static to become top layers. These internal classes lose their ability to use data or variables in local scope and other internal classes. Internal classes cannot declare any Static members; only top-level classes can declare Static members. Therefore, a member of a requirement Static member must use a member from the top level.

转载请注明原文地址:https://www.9cbs.com/read-85452.html

New Post(0)