List of Java keywords

A snippet of Java code with keywords highlighted in blue and bold font

In the Java programming language, a keyword is any one of 68 reserved words[1] that have a predefined meaning in the language. Because of this, programmers cannot use keywords in some contexts, such as names for variables, methods, classes, or as any other identifier.[2] Of these 68 keywords, 17 of them are only contextually reserved, and can sometimes be used as an identifier, unlike standard reserved words. Due to their special functions in the language, most integrated development environments for Java use syntax highlighting to display keywords in a different colour for easy identification.

  1. ^ "Java Platform, Standard Edition Java API Reference".
  2. ^ "Java Language Specification - Section 3.9: Keywords". The Java Language Specification. Oracle. 2018-08-21. Retrieved 2018-12-25.