Instance initializers allow you to execute construction code for an anonymous inner class.
实例初始化器允许您为一个匿名内部类执行构造代码。
For example, only final object references from the outer class are invokable within the body of the anonymous inner class.
例如,在匿名内联类的主体中,只能调用外部类中的 final 对象引用。
Here, the ActionListener implementation is defined in place, as an anonymous inner class, and directly attached to the button.
这里,ActionListener实现是适时定义的,它定义为一个匿名内部类,并直接附加到按钮上。
应用推荐