w********r 发帖数: 331 | 1 菜鸟一个, 这两天快被netbean搞疯了。
一个好好的package(运行正常)copy 到另外一个folder, 然后Netbean报错, 说
duplicate class.
另外一个constructor的里的变量原本好好的, copy后 就说local variable accessed
by innerclass, needs to be declared final.
求有经验的同学, 前辈们建议一下。 谢谢! | e*****t 发帖数: 1005 | 2 duplicate class: check if you do have duplicate classes (two classes with th
e same name in the same package).
About moving a variable reference, the compiler is right if you are referenc
ing it from any innerclass, it needs to be decalred final. If it can't be fi
nal, then you shouldn't refrence it directly, in other words, you should pas
s it in somehow.
accessed
【在 w********r 的大作中提到】 : 菜鸟一个, 这两天快被netbean搞疯了。 : 一个好好的package(运行正常)copy 到另外一个folder, 然后Netbean报错, 说 : duplicate class. : 另外一个constructor的里的变量原本好好的, copy后 就说local variable accessed : by innerclass, needs to be declared final. : 求有经验的同学, 前辈们建议一下。 谢谢!
| L*********s 发帖数: 3063 | 3 in IDE use refactoring instead of copying | b***i 发帖数: 3043 | 4 第二个问题请给出代码
accessed
【在 w********r 的大作中提到】 : 菜鸟一个, 这两天快被netbean搞疯了。 : 一个好好的package(运行正常)copy 到另外一个folder, 然后Netbean报错, 说 : duplicate class. : 另外一个constructor的里的变量原本好好的, copy后 就说local variable accessed : by innerclass, needs to be declared final. : 求有经验的同学, 前辈们建议一下。 谢谢!
|
|