Java Keywords
The keywords, also known as ‘reserved words’ have special meanings to Java language.
- All Java keywords are lowercase.
- An identifier can include a keyword as a part of its name, but it cannot have both the same letter case and spelling as a Java keyword..
- The keywords are case sensitive. For example, the identifier with the name IF is allowed, but is a bad programming practice and not recommended.
Following table lists Java keywords.
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 |
chatch | extends | int | short | try |
char | final | interface | static | void |
class | finally | long | strictfp | volatile |
const | float | native | super | while |
The keywords const
and goto
are reserved, they are not used anymore. true
, false
, and null
are actually literals but you cannot use them as identifiers in your programs.
You will learn more about usage of these keywords in upcoming lessons.