Java 中关键字和保留字有什么区别?
关键字
Java 中的关键字对编译器具有特殊含义,因此不能用作标识符。Java 提供了一组 50 个关键字。
| 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 | long | strictfp | volatile |
| const | float | native | super | while |
保留字
在上面列出的关键字列表中,关键字 goto 和 const 目前未使用。它们是保留字(供将来使用)。
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP