当前位置: 技术问答>java相关
大家看看这句话什么意思?(关于内部类)
来源: 互联网 发布时间:2015-05-25
本文导语: Any nested class, not just anonymous ones, can be declared in any block of code. A nested class declared within a method or other smaller block of code has access to any final, local variables in scope. | 不光是匿名类可...
Any nested class, not just anonymous ones, can be declared in any block of code. A nested class declared within a method or other smaller block of code has access to any final, local variables in scope.
|
不光是匿名类可以,其它任意嵌套类也可以被声明在程序块中,一个被声明在方法或小程序块中的嵌套类,有权访问嵌套它的方法或程序块中的final和local variables.