Java method names and variable name length up to how many characters ? Baidu did not find a clear answer. Seeking enlighten me !
------ Solution ---------------------------------------- ----
remember university teachers have said that java variable name character length limit
------ Solution -------------------- ------------------------
length is no limit , but I believe that nobody should take the name of the variable will be very long now , see the name EENOW is the most important
------ For reference only ------------------------------- --------
try it yourself chanting !
------ For reference only -------------------------------------- -
this is not important now , it is important to take other people can understand the meaning of the line
------ For reference only ------------------ ---------------------
theoretically there is no limit to the length , but is generally known to see the name meaning, no more than 20 characters ! !
------ For reference only -------------------------------------- -
no length limit , usually take simple articulate the meaning of the string. do not write a simple point others to see your code directly crash crash belch fart pull
------ For reference only ---------------------- -----------------
Available in the JLS find what
------ For reference only ----------- ----------------------------
no limit .
------ For reference only -------------------------------------- -
seemingly no length limit
------ For reference only ----------------------------- ----------
this is not important now . The project can not get too long ah.
------ For reference only -------------------------------------- -
this somewhat difficult ah
------ For reference only ---------------------------------- -----
this issue was not really meaning it
------ For reference only ------------------------ ---------------
I took over a project written by SB , the name long to die , just a method such as getLastAvailableMinuteIndexOfAvailableContinuousMinutesFromMinuteIndex (), a lot of this , I want to see dead !
------ For reference only -------------------------------------- -
see class class file format definition , method names usually use two bytes in length preservation, two bytes can represent a maximum length of 65535
So, the maximum length of the method name 65535
Here I'm not sure , should generally speaking Class class numbers in the file types are generally unsigned type
------ For reference only ---------- -----------------------------
add, is the character length , as in the end is 2 ^ 16 -1 or 2 ^ 17 -1, which was your own research
没有评论:
发表评论