Java has a total of 50 actively used reserved keywords that have predefined
meanings and cannot be used as identifiers such as variable names or class
names. Additionally, there are 2 reserved keywords, const
and goto
, which
are reserved but not currently used in the language. This brings the total
number of reserved keywords in Java to 52. However, with the latest Java SE 17
version, the number of keywords has increased to 67, including some new
contextually reserved or module-related keywords introduced in recent versions
of Java. To summarize:
- Java traditionally has 50 actively used keywords.
- 2 keywords (
const
andgoto
) are reserved but not used. - Java SE 17 LTS includes 67 keywords in total, reflecting additions for newer language features.
This means the exact count depends on the Java version, but commonly 50 keywords are considered actively used in standard Java programming, with the number growing in newer versions