I learned some of the inner classes in Java today.
An inner class is an inner class that places the definition of a class inside another class.
Indicates that a reference to the inner class type can be declared by the "external class name. Internal class name", if you want to return an object of an inner class, you can return an inner class object by writing a method in the outer class that returns the inner class, or through the "outer class object. New internal class name ()".
The inner class has access to all elements of the external class and can be accessed directly, while the outer classes need to first create an inner class object that can access any member of the inner class.
Inner classes can also inherit classes or implement interfaces, so they can also be transformed upward. An internal class implementation interface is a very useful way of writing, providing the designer of the class with the convenience of completely hiding the implementation details and blocking any encoding of the dependent type.
Inner classes can also be defined within a method or arbitrary scopes to define an inner class. For an inner class defined within a method, the inner class cannot be accessed outside of the method. It is also inaccessible to any defined inner class outside its scope, except that it is the same as the normal class.
Self-Study Java chapter Tenth inner Class (i)