例如,在匿名内联类的主体中,只能调用外部类中的final对象引用。
For example, only final object references from the outer class are invokable within the body of the anonymous inner class.
Groovy则消除了这种限制,在Groovy中,匿名内部类可以修改外部的变量值。
This restriction is lifted in Groovy; you can change the values of variables in a containing scope from within an anonymous inner class.
Groovy则消除了这种限制,在Groovy中,匿名内部类可以修改外部的变量值。
This restriction is lifted in Groovy; you can change the values of variables in a containing scope from within an anonymous inner class.
应用推荐