Internal static class static inner classes

Static inner classes

 

How to call external class properties and methods of static inner classes

   1) External non-static classes can call the static properties and methods within the class by the method of creating the internal static class instance

   2) external class directly through the "external type internal class. Property (Method)" method call static properties and methods static inner classes directly

How static inner classes call the properties and methods of the outer class 

    Static inner class member method if you want to access the member variables or external, it must be static

   1) static inner class can call the static properties and methods directly outside the class

   2) internal static class can be called non-static properties and methods outside the class by the method of creating class instances external

How to create a static inner class instance

  Create a static inner classes is not required when an instance of an object static inner classes bound to the instance of the object of the outer class

  Object static inner classes belong to the outer class, and not to the outside of class

   1) In the non-class external: internal external name class class name name = new class name inside the outer class name ();.

   2) in the outer class: class name name = new internal inner class name ();

How to call external class properties and methods of static inner classes

   1) External non-static classes can call the static properties and methods within the class by the method of creating the internal static class instance

   2) external class directly through the "external type internal class. Property (Method)" method call static properties and methods static inner classes directly

How static inner classes call the properties and methods of the outer class 

    Static inner class member method if you want to access the member variables or external, it must be static

   1) static inner class can call the static properties and methods directly outside the class

   2) internal static class can be called non-static properties and methods outside the class by the method of creating class instances external

How to create a static inner class instance

  Create a static inner classes is not required when an instance of an object static inner classes bound to the instance of the object of the outer class

  Object static inner classes belong to the outer class, and not to the outside of class

   1) In the non-class external: internal external name class class name name = new class name inside the outer class name ();.

   2) in the outer class: class name name = new internal inner class name ();

Guess you like

Origin www.cnblogs.com/wzq-xf/p/11796589.html