一、標識符
概念:就是用於給程序中的變量、類、方法命名的符號;
標識符規則:標識符可以有字母、數字、下划線_、和美元符號$組成,並且數字不能打頭
標識符不能使java關鍵字和保留字,但可以包含關鍵字和保留字
標識符不能包含空格
標識符只能包含美元符號$,不能包含@、#等其他特殊字符
分隔符:分號; 花括號{} 方括號[] 括號() 空格 圓點.;
二、Java關鍵字
java中包含50個關鍵,所有關鍵字都是小寫的
關鍵字列表:
abstract抽象的
assert
boolean
break
byte
case
catch
char
const(保留字)
continue
default
do
double
else
enum
extends
final
finally
float
for
if
goto(保留字)
implements
import
int interface
long native
new package
private protected
public return
short static
strictfp super
switch synchronized
this throw
throws transient
try void
volatile while
the literals true,false,and null are lowercase,not uppercase as in the C++ language.Strictky speaking,these are not keyworrds but literals;however,the distinction is academic。
三個特殊的直接量(literal);true false null 都不是關鍵字,但這個區別只是學術上的。所以,它們不可以做為標識符。