In this tutorial you will learn about the Java Keywords and its application with practical example.
Java Keywords
In Java, there are is a set of reserved words that you cannot use as an identifier. These words are known as “reserved words” or “Keywords”.
Keywords are standard identifiers and their functions are predefined by the compiler. We cannot use keywords as variable names, class names, method names, or any other identifier. Below is a list of available keywords in Java –
abstract | assert | boolean | break | byte |
case | catch | char | class | const |
continue | default | do | double | else |
enum | extends | final | finally | float |
for | goto | if | implements | import |
instanceof | int | interface | long | native |
new | package | private | protected | public |
return | short | static | strictfp | super |
switch | synchronized | this | throw | throws |
transient | try | void | volatile | while |
In addition to the above, you cannot also use true
, false
and null
as identifiers.