静态内部类 meaning in English
static i er cla es
static inner classes
Examples
- D . instance members of a static inner class can be referenced using the class name of the static inner class
的意思是不是说静态内部类的变量可以用静态内部类的名字来引用。 - Referring to enclosing type parameters inside static methods and static inner classes is prohibited outright by the compiler
编译器完全禁止在静态方法和静态内部类中引用封闭类型参数。 - It is possible to let the " this " reference escape without the word " this " appearing in your program ; publishing a nonstatic inner class instance has the same effect , because an inner class holds a reference to its enclosing object s " this " reference
如果“ this ”这个词不会出现在程序中,就可让“ this ”引用转义;发布一个非静态内部类实例可以达到相同的效果,因为内部类持有对它包围的对象的“ this ”引用的引用。 - Reference in a static variable or data structure is clearly a no - no , but there are more subtle ways to allow a reference to escape construction , such as publishing a reference to a nonstatic inner class , or starting a thread from within a constructor which almost invariably entails publishing the reference to the new thread
引用保存在静态变量或数据结构中,但是有更微妙的方式允许引用逃避构造,如公布对非静态内部类的引用,或者从构造函数中启动一个线程(这几乎总是公布对新线程的引用) 。