Legal Identifiers
■ Identifiers must start with a letter, a currency character ($), or a connecting
character such as the underscore ( _ ). Identifiers cannot start with a number!
■ After the first character, identifiers can contain a
ny combination of letters,
currency characters, connecting characters, or numbers.
■ In practice, there is no limit to the number of characters an identifier can
contain.
■ You can't use a Java keyword as an identifier. Table 1-1 lists all of the Java
keywords including one new one for 5.0, enum.
■ Identifiers in Java are case-sensitive; foo and FOO are two different identifiers.
Complete List of Java Keywords (assert added in 1.4, enum added in 1.5)
本文详细阐述了Java标识符的定义、组成规则、限制条件、关键字使用、大小写敏感性以及常见错误提示,帮助开发者深入理解并正确使用Java标识符。
943

被折叠的 条评论
为什么被折叠?



