JAVA关键字

Java语言中的所有关键字及其用法说明。

类和对象相关

序号 关键字 说明 文档链接
01 abstract 抽象类和抽象方法 abstract.md
02 class 类定义 class.md
03 enum 枚举类型 enum.md
04 interface 接口定义 interface.md
05 new 创建对象实例 new.md
06 this 当前对象引用 this.md
07 super 父类引用 super.md

继承和实现

序号 关键字 说明 文档链接
08 extends 类继承 extends.md
09 implements 接口实现 implements.md
10 instanceof 类型检查 instanceof.md

包和导入

序号 关键字 说明 文档链接
11 package 包声明 package.md
12 import 导入声明 import.md

访问修饰符

序号 关键字 说明 文档链接
13 private 私有访问 private.md
14 protected 受保护访问 protected.md
15 public 公共访问 public.md

修饰符

序号 关键字 说明 文档链接
16 static 静态成员 static.md
17 final 最终声明 final.md
18 abstract 抽象声明 abstract.md
19 synchronized 同步声明 synchronized.md
20 volatile 易变声明 volatile.md
21 transient 瞬态声明 transient.md
22 native 本地方法 native.md
23 strictfp 严格浮点 strictfp.md

异常处理

序号 关键字 说明 文档链接
24 try 异常处理块 try.md
25 catch 异常捕获 catch.md
26 finally 最终执行块 finally.md
27 throw 抛出异常 throw.md
28 throws 声明异常 throws.md

控制流

序号 关键字 说明 文档链接
29 if 条件判断 if.md
30 else 否则分支 else.md
31 switch 多路分支 switch.md
32 case 分支条件 case.md
33 default 默认分支 default.md
34 for 循环结构 for.md
35 while 条件循环 while.md
36 do do-while循环 do.md
37 break 跳出循环 break.md
38 continue 继续循环 continue.md
39 return 返回语句 return.md

数据类型

序号 关键字 说明 文档链接
40 void 无返回值 void.md
41 boolean 布尔类型 boolean.md
42 byte 字节类型 byte.md
43 char 字符类型 char.md
44 short 短整型 short.md
45 int 整型 int.md
46 long 长整型 long.md
47 float 单精度浮点型 float.md
48 double 双精度浮点型 double.md

保留关键字

序号 关键字 说明 文档链接
49 const 保留关键字(未使用) const.md
50 goto 保留关键字(未使用) goto.md

其他

序号 关键字 说明 文档链接
51 assert 断言语句 assert.md

使用说明

点击上表中的文档链接可以查看每个关键字的详细说明、语法规则和示例代码。每个关键字都有独立的文档页面,包含:

  • 关键字的基本概念和用途
  • 语法格式和使用规则
  • 实际应用场景
  • 完整的代码示例
  • 最佳实践建议
  • 常见错误和注意事项
powered by Gitbook© 2025 编外计划 | 最后修改: 2025-07-28 16:25:54

results matching ""

    No results matching ""