【Java】03 关键字 和 保留字

Java的关键字【Keyword】和 保留字【Reserved word】

 

官方描述: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html

 

什么是Keyword关键字?

  被赋予了特殊含义的字符,用作专门的用途的字符串(单词)

  java的所有关键字都是小写的

声明数据类型的关键字:

基本类型

void

boolean

byte

char

short

int

long

float

double

引用类型

class

interface

enum

声明流程控制的关键字

if

else

switch

case

default

while

do

for

break

continue

return

声明访问级别修饰的关键字

private

protected

public

声明状态相关的关键字  

abstract

final

static

synchronized

声明类关系的关键字

extends

implements

声明实例对象相关的关键字

new

this

super

instanceof

声明异常处理相关的关键字

try

catch

finally

throw

throws

声明用于包的关键字

package

import

其他修饰符的关键字

native

strictfp

transient

volatile

assert

声明字面值的关键字

true

false

null

什么是Reserved word保留字?

指在高级语言中已经定义过的字,使用者不能再将这些字作为变量名或过程名使用。

这些保留字,保留在Java源码中,但不能被开发使用!!!

goto

const

原文地址:https://www.cnblogs.com/mindzone/p/12703753.html