Java的关键字
Java有50个关键字,它们是
abstract do implements private throw
boolean double import protected throws
break else instanceof public transient
byte extends int return true
case false interface short try
catch final long static void
char finally native super volatile
class float new switch while
continue for null synchronized const
default if package this goto
这些关键字是保留字,不能使用保留字来命名类,方法或者变量。其中关键字const和goto是被保留但当前不可用的,有些说法是先行不可用,但是可能在以后可能回使用到,个人认为是为那些从c++的程序员设想的,试想一个习惯了goto和const的程序员,你很难保证他在使用java的时候,不会出现这样的字符,所以保留它,也不至于他们在使用java的时候,一个习惯,使得程序乱七八糟。
Java有50个关键字,它们是
abstract do implements private throw
boolean double import protected throws
break else instanceof public transient
byte extends int return true
case false interface short try
catch final long static void
char finally native super volatile
class float new switch while
continue for null synchronized const
default if package this goto
这些关键字是保留字,不能使用保留字来命名类,方法或者变量。其中关键字const和goto是被保留但当前不可用的,有些说法是先行不可用,但是可能在以后可能回使用到,个人认为是为那些从c++的程序员设想的,试想一个习惯了goto和const的程序员,你很难保证他在使用java的时候,不会出现这样的字符,所以保留它,也不至于他们在使用java的时候,一个习惯,使得程序乱七八糟。