实例内部类(Instance inner classes) 假设你在声明嵌套类时,没有在前面加上static关键字。这样你得到的不是一个嵌套顶级类, 你得到的是一个实例内部类。
基于42个网页-相关网页
Instance initializers allow you to execute construction code for an anonymous inner class.
实例初始化器允许您为一个匿名内部类执行构造代码。
The first set of enclosing braces delineates the construction of an anonymous inner class, and the second set delineates the instance initializer for the anonymous inner class.
第一组闭合括弧划定一个匿名内部类的构造,第二组划定匿名内部类的实例初始化语句块。
For example, the semantics of return, break, and this are different in a block of code than they are in a Runnable (or other inner class instance) that represents the same block of code.
比如,return、break和this在某一代码块中的语义与其在Runnable(或其他内部类实例)中同一代码块中的语义是不同的。
应用推荐