In this tutorial, you’ll learn about Java Keywords which reserved and cannot be modified Java Programming.
The Java programming language has the total of 50 reserved keywords which have special meaning for the compiler and cannot be used as variable names.
The Following is a list of all Java keywords in alphabetical order, click on an individual keyword to see its description and usage example.
Some noteworthy points regarding Java keywords:
- const and goto are reserved words but not used.
- true, false and null are literals, not keywords.
- all keywords are in lower-case.
The following table shows the keywords grouped by category used in Java:
|Access modifiers||private, protected, public|
|Class, method, variable modifiers||abstract, class, extends, final, implements, interface, native, new, static, strictfp, synchronized, transient, volatile|
|Flow control||break, case, continue, default, do, else, for, if, instanceof, return,switch, while|
|Package control||import, package|
|Primitive types||boolean, byte, char, double, float, int, long, short|
|Error handling||assert, catch, finally, throw, throws, try|
|Others||super, this, void|
- goto and const – are not used
- enum – is present since Java 5.0
- strictfp – is present since Java 1.2
- assert – is present since Java 1.4
- In addition, the identifiers null, true and false denote literal values and may not be used to create identifiers.
Recommended Book: Beginning Programming with Java For Dummies (Cover Java 7)
Ask your questions and clarify your/others doubts on Java Keywords by commenting. Java Documentation.
JAVA NAMING CONVENTION