Possible Duplicate:
Max name length of variable or method in Java
I was reading the java docs and it says “A variable’s name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits … “ in c++ the variable name length is around 255 characters depending on the compiler, so how is this handled in java does the compiler truncate the variable name after x number of characters, and if this is true what would be x ?
According to the class file format spec (under section 4.11):
This applies to local variables as well because of the LocalVariableTable pointing to CONSTANT_Utf8_info values for the variable names.