inner classes 中文意思是什麼
inner classes
解釋
內部類:內部類與一般的類相似,只是它被聲明在類的內部,或者甚至某個類方法體中。-
This includes publishing references to nonstatic inner classes, and generally precludes starting threads from within a constructor
這包括發布對nonstatic內部類的引用,並一般要避免在構造函數中啟動線程。 -
Normally, such listeners are specified as instances of anonymous inner classes using the command pattern
通常,這樣的偵聽器通過使用命令模式( command pattern )被指定為匿名內部類的實例。 -
Referring to enclosing type parameters inside static methods and static inner classes is prohibited outright by the compiler
編譯器完全禁止在靜態方法和靜態內部類中引用封閉類型參數。 -
Custom attributes may not be inner classes
自定義屬性不能是內部類。 -
For java programmers this is reminiscent of inner classes
對于java程序員,可能會回想起內部類。 -
Only inner classes can be static
只有內部類可以是靜態的。 -
Listing 9, the basis of a graphical clock, uses inner classes
清單9 ,一個圖形時鐘的基礎,使用了內部類。 -
More precisely, the action takes place within two inner classes : class
更準確地說,操作發生在兩個內部類中: -
Anonymous inner classes are handy when you want to define callbacks on the fly
匿名內部類可以方便的定義運行時回調。 -
Inner classes are very convenient when you are writing event - driven programs
使用內部類在編寫事件驅動時的程序時用起來很方便。 -
Anonymous inner classes
匿名內部類 -
This code uses an anonymous inner class, but you may also use named inner classes or independent classes as listeners
此代碼使用了一個匿名的內部類,但您還可以使用指定的內部類或單獨的類作為監聽器。 -
While i could do something similar with java code using anonymous inner classes, it s simply easier and less esoteric in groovy
雖然我用java代碼時能用匿名內部類做類似的事情,但是用groovy更容易、神秘性更少一些。
分享友人