Keywords in Java

Java keywords are special reserved words that have predefined meanings in the Java compiler. They form the foundation of the language syntax and cannot be used as identifiers.


  • Keywords are special reserved words with predefined meaning to the Java compiler.

  • They help the compiler understand what your source code is trying to perform.

  • Keywords cannot be used as identifiers like class names, methods, or variables.

Java Language Keywords

Here is the complete list of Java keywords:

abstract continue for new
switch assert default goto
package synchronized boolean do
if private this break
double implements protected throw
byte else import public
throws case enum instanceof
return transient catch extends
int short try char
final interface static void
class finally long strictfp
volatile const float native
super while
Reserved Keywords Not in Use
const goto (Reserved but not implemented)

Added in Java 1.2: strictfp
Added in Java 1.4: assert
Added in Java 1.5: enum

Next: Java Variables



πŸš€ Quick Knowledge Check

Topic: Keywords | Language: Java

Q1. Which keyword was added in Java 1.5?
Q2. Which keyword was added in Java 1.2?
Q3. Which of the following can keywords NOT be used as?
Q4. Which of the following keywords is reserved in Java but never implemented?
Q5. Which of the following is a reserved keyword but not used in Java?
Q6. What does the 'strictfp' keyword ensure?
Q7. What are Java keywords?
Q8. Which of the following is TRUE about the keyword 'const' in Java?
Q9. Which keyword was added in Java 1.4?