Thursday, 26 October 2017

Keywords in Java

The java programming language has total of 50 reserved keywords which have special meaning for the compiler and can not be used for used as identifiers. 

Here list of keywords in the Java programming language

1. abstract           2.assert                           3.boolean          4.break                5.byte                 7.catch                            8.char                9.class                 10.const 

11.continue       12.default                               14.double            15.else 

16.enum            17.extends                           19.finally            20.float   

21.for                22.goto                            23.if                   24.implements    25.import    

26.instanceof                               28.interface       29.long                30.native              32.package                      33.private          34.protected        35.public

36.return           37.short                           38.static             39.strictfp           40.super   

41.switch          42.synchronized             43.this                44.throw             45.throws

46.transient       47.try                             48.void               49.volatile           50.while

The keywords const and goto are reserved, even though they are not currently used.

true, false and null might seem like keywords, but they are actually literals, you can not use them as identifiers in programs.

Note: All the keywords should be used in lower case.