Java Keywords
Java Keywords
Keywords in Java are also known as reserved words. These are the predefined words
therefore they can’t be used as a variable name. If we will use keywords as a variable
name, the result will be a compile-time error. The list of all the Java Keywords is given
below.
byte if static
do native transient
Examples:
Correct
int x = 10;
int _x = 10;
int $x = 10;
Int x1 = 10;
1
Incorrect
int 1x = 10;
int num ber = 10;