Java中的关键字和保留字

2024-01-08 15:47:25

类和修饰符

● class
● interface
● enum
● extends
● implements
● abstract
● final
● static
● strictfp

数据类型

基本数据类型

● byte
● short
● int
● long
● float
● double
● char
● boolean

引用数据类型关键字

● class
● interface
● enum

流程控制

● if
● else
● switch
● case
● default
● for
● while
● do
● break
● continue
● return
● throw
● throws
● try
● catch
● finally

包和导入

● package
● import

访问控制

● public
● protected
● private

对象和实例化

● new
● this
● super

异常处理

● try
● catch
● finally
● throw
● throws

线程和同步

● synchronized
● volatile

其他

● assert
● const(Java5 中引入,但未使用,Java 10 中被标记为过时)
● goto(Java 1.1 中引入,但未使用,Java14 中被标记为过时)
● transient
● native
● strictfp
● default(在接口中引入,默认方法)

Java 17 引入的特定关键字

● by
● enum
● from
● future
● inner
● operator
● outer
● rest
● var

文章来源:https://blog.csdn.net/dejunyang/article/details/135457273
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。