静态内部类(Static Inner Classes) 如果一个内部类不需要对它的外部类(outer class)进行引用,那个你可以把它声明为static。当一个类中的静态方法调用一个内部类时,那么这个内部类必须是静态内部类。
基于92个网页-相关网页
除非是在宿主类(outer class)的非static方法中,否则无论我们在哪里创建内部类的对象都必须用OutClassName.InnerClassName的形式来表示这个对象的类型。
基于1个网页-相关网页
Outer class variable 外部类变量
in and outer class 短期职业训练班
outer-class teaching channel 课外教学途径
outer-insulation pollution class 外绝缘污秽等级
Note that when a class is nested, it has access to the outer class's members.
请注意,当一个类是嵌套类的时候,它可以访问其外层类的成员。
Field in the inner class hides a field with the same name in the outer class.
内部类中的域在外部类中覆盖了一个相同名字的域。
For example, only final object references from the outer class are invokable within the body of the anonymous inner class.
例如,在匿名内联类的主体中,只能调用外部类中的 final 对象引用。
应用推荐