现在的位置: 首页 > 综合 > 正文

Java关键字

2018年04月01日 ⁄ 综合 ⁄ 共 1282字 ⁄ 字号 评论关闭
文章目录

1 Java关键字

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html

Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords const and gotoare reserved, even though they are not
currently used. truefalse, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.

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
**   added in 1.2
***   added in 1.4
****   added in 5.0

2 关键字分类

http://www.java3z.com/cwbwebhome/article/article8/81253.html?id=2799

2.1 访问控制

private 私有的
protected 受保护的
public 公共的

2.2 类、方法和变量修饰符

abstract 声明抽象
class 类
extends 扩允,继承
final 终极,不可改变的
implements实现
interface 接口
native 本地
new 新,创建
static 静态
strictfp 严格,精准
synchronized 线程,同步
transient 短暂
volatile 易失

2.3 程序控制语句

break 跳出循环
continue 继续
return 返回
do 运行
while 循环
if 如果
else 反之
for 循环
instanceof 实例
switch 开关
case 返回开关里的结果
default 默认

2.4 错误处理

catch 处理异常
finally 有没有异常都执行
throw 抛出一个异常对象
throws 声明一个异常可能被抛出
try 捕获异常

2.5 包相关

import 引入
package 包

2.6 基本类型

boolean 布尔型
byte 字节型
char 字符型
double 双精度,
float 浮点
int 整型
long 长整型
short 短整型

2.7 变量引用

super 父类,超类
this 本类
void 无返回值

【上篇】
【下篇】

抱歉!评论已关闭.