The final local variable xxx cannot be assigned, since it is defined in an enclosing type“,
来源:互联网 发布:app软件产品说明书 编辑:程序博客网 时间:2024/05/16 13:46
本文就自己编程时候遇到的一个问题,简要描述一下,并提出解决的方法:
出错信息:The final local variable xxx cannot be assigned, since it is defined in an enclosing type“,其中xxx是一个局部变量名
首先这是一个java编译时的错误,翻译成中文是:不可变的局部变量不能被赋值,因为它已经被定义在一个封闭类型中。
解决的办法:将xxx 作一下封装,用集合或者数组,如果xxx是基本数据类型一般用数组。
如:xxx为 String类型的话,
可以封装成 String[] xxx=null;
然后在接下来用到 xxx 变量的地方, 将xxx 写成 xxx[0];
xxx 如果为对象的话,那么可以用集合 将xxx进行封装.....
0 0
- The final local variable xxx cannot be assigned, since it is defined in an enclosing type
- The final local variable xxx cannot be assigned, since it is defined in an enclosing type
- The final local variable xxx cannot be assigned, since it is defined in an enclosing type“
- The final local variable xxx cannot be assigned, since it is defined in an enclosing type“,
- The final local variable xxx cannot be assigned, since it is defined in an enclosing type
- The final local variable xxx cannot be assigned, since it is defined in an enclosing type
- The final local variable cannot be assigned, since it is defined in an enclosing type
- The final local variable cannot be assigned, since it is defined in an enclosing type的解决办法(把变量从局部编程)
- 解决问题:Cannot refer to the non-final local variable user defined in an enclosing scope
- 16-07-31 Cannot refer to the non-final local variable homePageInfo defined in an enclosing scope
- The type java.xxx.Xxx cannot be resolved. It is indirectly referenced from required.class
- The type XXX cannot be resolved. It is indirectly referenced from required .class files错误.....
- the type xxx cannot be resoved,It is indirectly referenced from required .class files错误.....
- The type XXX cannot be resolved. It is indirectly referenced from required .class files
- [Eclipse] The type XXX cannot be resolved. It is indirectly referenced from required .class files错误.
- [Eclipse] The type XXX cannot be resolved. It is indirectly referenced from required .class files错误.
- The type XXX cannot be resolved. It is indirectly referenced from required .class files错误
- The type XXX cannot be resolved. It is indirectly referenced from required .class files
- 循环链表
- ubuntu 使用
- 快速排序算法
- php get_post 提交
- [转载论文]蚁群算法在最优路径上的应用
- The final local variable xxx cannot be assigned, since it is defined in an enclosing type“,
- Android之View篇①
- Android之使用wifi连接adb
- 3D拾取技术
- 关于简历的那些事——记微信内推之无知
- 聚类
- HDU 3340 Rain in ACStar(线段树+几何)
- flex学习
- memcached安装及与spring集成