y***y 发帖数: 224 | 1 From wiki:
This is because the local class instance must maintain a separate copy of
the variable, as it may out-live the function; so as not to have the
confusion of two modifiable variables with the same name in the same scope,
the variable is forced to be non-modifiable
感觉必须加final更像一个硬性规定? | e*****t 发帖数: 1005 | 2 http://stackoverflow.com/questions/1299837/cannot-refer-to-a-no
ble-inside-an-inner-class-defined-in-a-differen
,
【在 y***y 的大作中提到】 : From wiki: : This is because the local class instance must maintain a separate copy of : the variable, as it may out-live the function; so as not to have the : confusion of two modifiable variables with the same name in the same scope, : the variable is forced to be non-modifiable : 感觉必须加final更像一个硬性规定?
|
|