`
xinklabi
  • 浏览: 1590940 次
  • 性别: Icon_minigender_1
  • 来自: 吉林
文章分类
社区版块
存档分类
最新评论

The final local variable xxx cannot be assigned, since it is defined in an enclo

    博客分类:
  • Java
 
阅读更多

 本文就自己编程时候遇到的一个问题,简要描述一下,并提出解决的方法:

               出错信息: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进行封装.....

分享到:
评论

相关推荐

    2009 达内Unix学习笔记

    集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...

    quartus常见错误

    Warning: Clock latency analysis for PLL offsets is supported for the current device family, but is not enabled 当Quartus II提示时钟延迟分析对于当前设备系列支持PLL偏移分析但未启用时,这表明你没有正确...

    a project model for the FreeBSD Project.7z

    It is well defined what issues the hat should be contacted about by the project members and people outside the project. 2.4. Outcome An “outcome” is the final output of the process. This is ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    If an inline function definition is short, with very little, if any, logic in it, you should put the code in your .h file. For example, accessors and mutators should certainly be inside a class ...

    servlet2.4doc

    Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked. doFilter(ServletRequest, ...

    计算机网络第六版答案

    Hence, it becomes possible for the attacker to issue a command to all the nodes, that target a single node (for example, all nodes in the botnet might be commanded by the attacker to send a TCP SYN ...

    NewSID(光学习一下代码就可以了,没看清楚介绍别运行)

    Since the domain the BDC is now associated with already has an active PDC, it will boot as a BDC in its new domain. The BDC will show up as a workstation in Server Manager, so use the "Add to ...

    Autosar EXP ModemanagementGuide

    to be defined, which is assigned to the variable at startup. Figure 2.1 shows an excerpt of the AUTOSAR Metamodel [3] with the relationships of ModeDeclarations, ModeDeclarationGroups and Executable ...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    The new functions are assigned higher ordinal numbers than the earlier commands, so the ordinal numbers assigned to routines in the earlier VsDrvr routines are preserved. This means one may use the ...

    Debugging Malloc Lab: Detecting Memory-Related Errors

    errorfl() obviously cannot be used on situations where FREE() is called on an unallocated block, since it was not ever MALLOC'd. Note: You will only be reporting errors from MyFree(). None of the ...

    acpi控制笔记本风扇转速

    ResourceTemplate, but cannot be disassembled as such because the EndTag does not appear at the very end of the buffer. AcpiExec - Added the "-t" command line option to enable the serialized mode of ...

    An Illustrated Introduction to Topology and Homotopy, Kalajdzievski, 2015.pdf

    The Analysis course was assigned to me due to an emergency redistribution; Topology was thrown in as an award for accepting to teach Analysis on such short notice. Algebraic topology, which covered ...

    微软内部资料-SQL性能优化3

    In this scenario, since T1 believes it locks the entire table, it might inadvertently make changes to the same row that T2 thought it has locked exclusively. In a multigranular locking environment, ...

    数位板压力测试

    When the user is viewing the device in its normal position, the coordinate origin will be at the lower left of the device. The coordinate system will be right-handed, that is, the positive x axis ...

    王小平版遗传算法的光盘源代码

    Note: since the random seed value is not a population parameter but it can be specified in the population parameters file, if there are multiple populations, and no seed value was specified on the ...

    i-vector的工具箱

    In case Matlab is not installed or Matlab license is not available (for instance on a computer cluster), we provide standalone executables that can be used in conjunction with the Matlab Compiler ...

    polycom宝利通视频会议软件3.9 2018

    A USER license is for an individual or single video conferencing device USER only and cannot be shared or used by more than one individual or multiple video conferencing devices not assigned to a ...

    NIST SP800-53-rev2-final.pdf

    The answers to these questions are not given in isolation but rather in the context of an effective information security program for the organization that identifies, controls, and mitigates risks to ...

Global site tag (gtag.js) - Google Analytics