来个按字母顺序排列:)abstract
break byte boolean
catch case class char continue
default double do
else extends
false final float for finally
if import implements int interface instanceof
long length
native new null
package private protected public
return
switch synchronized short static super
try true this throw throws threadsafe transient
void
while
break byte boolean
catch case class char continue
default double do
else extends
false final float for finally
if import implements int interface instanceof
long length
native new null
package private protected public
return
switch synchronized short static super
try true this throw throws threadsafe transient
void
while
abstract boolean break byte case
catch char class continue default
do double else extends false
final finally float for if
implements import instanceof int interface
long native new null package
private protected public return short
static super switch synchronized this
throw throws transient true try
void volatile while 保留关键字
const,goto^_^
http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=178818
生命就是因为奋斗而变得美丽
人家散分,我就接 ...... 不懂的问题,我就进来学习,UP接分 ...... 知道一点的问题,我就给个意见,顺便UP接分 ...... 我懂的问题,那就赶紧回答,也就是进来抢分的 ......
你那两个保留关键字const,goto已经在jdk里被弃用了,不算的。没有奖励!
-------------
但你如果使用const go 作变量名,即编译报错。
boolean byte char int long short float doublekeywords for access control are:
private protected publickeywords for modifiers are:
abstract final native private protected public
static transient synchronized volatile strictfpkeywords for catch-exception are:
try catch finally throwkeywords for loops or decision-makers are:
break case continue default do while for
switch if elsekeywords for class functions are:
class extends implements import instanceof
new package return interface
this throws void superkeywords for assigned values are:
true false nullAssert arrived with JDK 1.4. Const and goto are not currently used. They may be there just in case C++ programmers use them by mistake to enable the compiler to give a more meaningful error message.板竹贴出来的咋乱的,这样看是不是爽点。^_^
另外注意一下:
1、全小写,类似instanceOf、NULL就不是关键字了。
2、java不会轻易的添加关键字,试想如一下子加入then、sizeof等则原代码中标识符设为then、sizeof的均需更改。所以仔细看好了,就上面几个老熟脸。BTW:Focus on programming techniques,not on language features。
public MyThread implements Runnable{
private int flag;
private MyThread(int flag){
this.flag=flag;
}
public void run(){
falg=0;
}
}
那么现在你就修改的是flag的备份,只有在进入和退出synchronized同步块时同步原始数据,但是使用volatile这个关键字说明的就是不考备备份,直接使用原始数据,但是这样又会影响运行效率,所以值得斟酌权衡一下
很少用的一个,使浮点数符合标准
ltzperson(玩人大帝):
太乱了,
如果再说明他是干什么用的那就再好不过了,
说来介绍一下
---------------------------------------
本来就是想让大家一起参与的呀。每个人都来说说自己的看法或者用法。
比如HelloWorld里面除了用到了上面说到的关键字外,还有一些特殊作用的public class HelloWorld { //空格,{
public static void main(String[] args) { //(, [, ], )
System.out.println("HelloWorld"); //., ", ;
}
} // }
缺省的类类型都算是frend友元类。不当之处望指正。
friendly只是一种表达而已,算不得关键字的
-------------------------------------------
to all:
我先集大成一哈:)
-------------------------------------------
by ntzls(三星堆):
------------------
Const & goto:
------------------
Const and goto are not currently used. They may
be there just in case C++ programmers use them
by mistake to enable the compiler to give a
more meaningful error message.
-------------------------------------------
by moke33(Mr.Li ★ 我爱冰冰):
------------------
transient:
------------------
transient表示在一个序列化类的时候不被序列化,
如密码等敏感的值域可以用transient来修饰
-------------------------------------------
by shangqiao(伤桥):
------------------
volatile:
------------------
做线程时volatile非常重要,用不好可能会影响你的
结果或是效率。当新建一个线程时,为了提高效率,
他会将某些数据考一个备份到自己这里,所以有可能
你在线程中修改了数据,但是修改的只是你自己的备
份而已,而不会影响到原始的数据。如下代码:
public MyThread implements Runnable{
private int flag;
private MyThread(int flag){
this.flag=flag;
}
public void run(){
falg=0;
}
}
那么现在你就修改的是flag的备份,只有在进入和退出
synchronized同步块时同步原始数据,但是使用volatile
这个关键字说明的就是不考备备份,直接使用原始数据,
但是这样又会影响运行效率,所以值得斟酌权衡一下所以假如两个线程使用同一个flag通信的话,那么就应该注意了
-------------------------------------------
by kingfish(八百里秦川@龙城异客):
------------------
strictfp:
------------------
很少用的一个,使浮点数符合标准
-------------------------------------------
by ntzls(三星堆):
------------------
Assert:
------------------
Assert arrived with JDK 1.4.
-------------------------------------------
我来说两句:
--------------------------------------------------------------
transient This variable's value won't persist when the object is stored.将对象存储的时候变量的值不变这是在对对象序列化的时候起作用,也就是说被声明的变量不会
自动序列化到介质中。通常对实现序列化接口的类中的某些属性
或方法声明。
呵呵,这个就是现实吗。只是以前自己作为过客,不当回事情罢了,现在轮到自己做斑竹力图改变一些现状却不得。哈哈。