0% found this document useful (0 votes)
53 views

Java Keywords

The document discusses Java keywords which are predefined words that cannot be used as variable names and will result in a compile-time error if used. It provides a list of all Java keywords such as abstract, assert, boolean, break, byte and examples of correct and incorrect variable names.

Uploaded by

drishyaanil9396
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Java Keywords

The document discusses Java keywords which are predefined words that cannot be used as variable names and will result in a compile-time error if used. It provides a list of all Java keywords such as abstract, assert, boolean, break, byte and examples of correct and incorrect variable names.

Uploaded by

drishyaanil9396
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

abstract final protected

assert finally public

boolean for return

break float short

byte if static

catch implements super

char import switch

case instanceOf synchronized

class int this

continue interface throw

default long throws

do native transient

double new try

else null void

enum package volatile

extends private while

Examples:

Correct

int x = 10;
int _x = 10;
int $x = 10;
Int x1 = 10;

1
Incorrect

int 1x = 10;
int num ber = 10;

You might also like