一、关键字
- Java关键字都是小写字母
- Java关键字一共有五十个
abstract continue for new switch
assert default goto package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp volatile
const float native super while
- not used(保留字):const goto
- added in 1.2: strictfp
- added in 1.4: assert
- added in 5.0: enum
二、标识符(identifier)
- 标识符的命名规则:
- 由大写字母、小写字母、数字(0-9)、下划线(_)、$符号组成
- 数字不能用于第一位
- 不能使用关键字和保留字
- 严格区分大小写
三、变量