- Previous
- Next
Keywords are reserved words in Java programming language. You cannot use these words for any other purpose such as variable names. The Java keywords are instructions to the compiler which interpret the meaning of these keywords and execute the command.
Here is the list of commonly used keywords in Java language.
Keyword | Description |
abstract | To declare a class abstract for abstract method. |
boolean | Boolean data type with values – true or false. |
break | Breaks a case or a loop in java program. |
byte | Data type that stores 8-bit signed integer or byte value. |
case | Part of switch-case block |
catch | Part of try block that catch exceptions |
char | Character data type |
class | Template for objects in Java |
const | Not allowed to use, replaced by final keyword |
continue | In a loop skip an interation and continue |
default | To declare default values and methods |
do | Part of do-while loop |
double | Double data type |
else | Part of if-else block |
extends | To Declare a sub-class |
final | Final variables cannot be reassigned |
finally | The finally block used in exception handling |
float | Floating point data type |
for | For loop |
goto | Does not use goto statement which is to jump to a specific location in program |
if | if block |
implements | To implement an interface |
import | Import packages |
instanceof | To test if an object is instance of a specific class, subclass or interface |
int | Integer data type |
interface | To declare interfaces |
long | long data types |
native | |
new | To create new objects |
package | Package contains classes |
private | Private scope of a class |
protected | Protected Scope of a class |
public | Public scope of a class |
return | Returns a value from function |
short | short data type |
static | |
strictfp | |
super | |
switch | |
synchronized | |
this | |
throw | |
throws | |
tranient | |
try | |
void | |
volatile | |
while |