Java.Variable name length

后端 未结 4 1466
被撕碎了的回忆
被撕碎了的回忆 2021-01-28 01:11

in documentation i read, that:

A variables name can be any legal identifier — an **unlimited-length** sequence of Unicode letters and digits

so

4条回答
  •  伪装坚强ぢ
    2021-01-28 01:57

    The local variable names are not stored as such. They tend to be removed as part of the compiler optimization and replaced with numbers (see aload_ for example).

    Try to compile with javac -g or javac -g:vars, it should leave more information, which you'll be able to check with javap.

    This answer should have interesting details on this topic.

    Since your example code doesn't actually do anything anyway, it's likely to be optimized into an empty method.

提交回复
热议问题