1. Internal classes can be static, protect, and private, but external classes containing internal classes can only use public and default package access permissions.
2. The internal class can access the content of the external class object that creates it, and even include the private variable.
3. classification of internal classes ● Member internal classes (an internal class exists as a member of an external class, and is in parallel with the external class methods and attributes .) outer. inner inner = outer. new inner (); // in this way, new inner outer is an external Class Object
● Local internal class (the internal class defined in the method is called a local internal class. it is similar to a local variable, so the local internal class cannot have an access modifier, because it is not an external class member, but it can access the constants of the code block in the current method, and all external class members .) new inner (). tostring (); // note that the internal class method is called in this way
● Static internal class (nested class) (the internal class exists as a member of the external class and is in parallel with the method and attribute of the external class, but is modified using static, you cannot access non-static external class objects through static internal class objects.) Inner inner = new inner (); // an internal class object is generated here and you no longer need to access external class objects.
● Anonymous internal class (an anonymous internal class is a class without a name. The new statement is followed by the class Rewriting Method)