Java language foundation - Identifier
Others
2020-03-01 20:47:52
views: null
Java language foundation - Identifier
What is the identifier?
- In the Java source code among programmers who have the right to name their own words are identifiers.
- Identifier may identify what elements?
- The class name
- Method name
- Interface name
- Constant name
Identifier naming rules? (grammar)
- Only numbers, letters, underscores _ the dollar sign ($) composition, can not contain other symbols.
- You can not start with a number
- Strict distinction between the case
- Keywords can not do identifier
- In theory no length limit , it is best not too long
Naming identifiers? (Just standard, not part of the syntax, do not comply with specifications not being given)
- Best to see to know the name meaning : that saw the name, I know this is what to do with.
- Compliance hump naming :
- Class name, interface name : capitalize the first letter of each word capitalized later.
- Variable names, method names : lowercase first letter, after each initial capital letters.
- Constant name : All caps
Released three original articles
·
won praise 5
·
Views 1629
Origin blog.csdn.net/lolly1023/article/details/104597910