Keywords have a special meaning in a language, and are part of the syntax.

Reserved words are words that cannot be used as identifiers (variables, functions, etc.), because they are reserved by the language.

In practice most keywords are reserved words and vice versa. But because they're two different things it may happen that a keyword is not a reserved word (e.g. a keyword only has meaning in a special context, and can therefore be used as an identifier), or a reserved word is not a keyword (e.g. because it is reserved for future use).

Update: Some examples as given by others that illustrate the distinction:

  • In Java, goto is a reserved word but not a keyword (as a consequence, you cannot use it at all)
  • Fortran has no reserved words, all keywords (if, then, etc.) can be used as identifiers
Answer from molf on Stack Overflow
🌐
W3Schools
w3schools.com › java › java_ref_keywords.asp
Java Keywords
Java has a set of keywords that are reserved words that cannot be used as variables, methods, classes, or any other identifiers:
🌐
Wikipedia
en.wikipedia.org › wiki › List_of_Java_keywords
List of Java keywords - Wikipedia
October 20, 2025 - In the Java programming language, a keyword is any one of 68 reserved words 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.
🌐
Medium
medium.com › @mukherjeesourabh07 › reserved-keywords-in-java-791b65df5707
Reserved keywords in Java. Reserved keywords | by Sourabh Mukherjee | Medium
January 15, 2024 - Based on Exception Handling: try, ... — 1 keyword ... All the reserved keywords are in lowercase only. There is no reserved keyword for deleting the object because it is the job delegated to the Garbage collector program in ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-keywords
Java Keywords - GeeksforGeeks
August 27, 2018 - In Java, keywords are the reserved ... some predefined actions. These words cannot be used as identifiers such as variable names, method names, class names, or object names....
🌐
Oracle
docs.oracle.com › javase › tutorial › java › nutsandbolts › _keywords.html
Java Language Keywords (The Java™ Tutorials > Learning the Java Language > Language Basics)
Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords const and goto are reserved, even though they are not currently used.
🌐
ThoughtCo
thoughtco.com › reserved-words-in-java-2034200
Reserved Words in Java
January 27, 2019 - ... Reserved words are words that cannot be used as object or variable names in a Java program because they're already used by the syntax of the Java programming language. If you ttempt to use any of the words below as identifiers in your Java ...
🌐
TechVidvan
techvidvan.com › tutorials › keywords-in-java
Keywords in Java - Java Reserved Words - TechVidvan
June 5, 2020 - These are reserved for special purposes and we cannot use them as identifier names otherwise the compiler will give an error. In Java. there are 51 keywords, but 2 of them are not used which are-goto and const.
Find elsewhere
🌐
Wikipedia
en.wikipedia.org › wiki › Reserved_word
Reserved word - Wikipedia
October 17, 2025 - In an imperative programming language and in many object-oriented programming languages, apart from assignments and subroutine calls, keywords are often used to identify a particular statement, e.g. if, while, do, for, etc. Many languages treat keywords as reserved words, including Ada, C, ...
🌐
Javatpoint
javatpoint.com › java-reserved-keywords
Java Reserved Keywords - Javatpoint
Java Reserved Keywords with java tutorial, features, history, variables, object, programs, operators, oops concept, array, string, map, math, methods, examples etc.
🌐
How to do in Java
howtodoinjava.com › home › java basics › java reserved and contextual keywords
Java Reserved and Contextual Keywords
December 27, 2022 - Java has 51 reserved words and 16 contextual keywords that cannot be used as identifiers in the code. Programmers should not use these keywords for other purposes.
🌐
Computer Hope
computerhope.com › jargon › j › java_reserved_words.htm
What Are Java Reserved Words?
Java reserved words are keywords that are reserved by Java functions or other uses that cannot be used as identifiers (e.g., variable names, function names, class names).
🌐
Medium
medium.com › @lk.snatch › java-reserved-keywords-29618c31a797
Java reserved keywords.
February 6, 2020 - Java reserved keywords. Programming languages have always reserved keywords, that cannot be used in a particular context. Wanna write «String class = “I can do anything!”»? You can write that …
🌐
Stack Overflow
stackoverflow.com › questions › 68555224 › what-is-the-difference-between-keywords-and-reserved-words-in-java
syntax - What is the difference between keywords and reserved words in Java? - Stack Overflow
The docs clearly says: Here is a list of keywords in the Java [...]. You cannot use any [...]. The keywords const and goto are reserved, even though they are not currently used..
🌐
Java Challengers
javachallengers.com › home › keywords vs reserved words in java
Keywords VS Reserved Words in Java
January 18, 2021 - In the most recent Java releases, reserved identifiers that can be used as a Java identifier. To make a comparison between the most recent reserved identifiers and the previous keywords or reserved words; reserved identifiers can be used as a class, method, or variable names and keywords can’t!
🌐
Baptiste-wicht
baptiste-wicht.com › posts › 2010 › 02 › java-keywords.html
The reserved keywords of the Java Language | Blog blog("Baptiste Wicht");
February 3, 2010 - There is also an other kind of ... = new SimpleObject[x]; //... for(SimpleObject object : objects){ object.doSomething(); } ... This keyword is reserved but not used....
🌐
Medium
medium.com › @rasulattar0705 › a-comprehensive-guide-to-java-reserved-words-b82a50569125
A Comprehensive Guide to Java Reserved Words | by Rasul Attar | Medium
December 12, 2024 - Keywords for defining and working with Java classes: class, interface, extends, implements, package, import ... All reserved words are lowercase. Java is case-sensitive, so reserved words like Int or InstanceOf are invalid.
🌐
Medium
shweta-lokhande19.medium.com › java-identifiers-reserved-keywords-and-control-statements-e87e1f6f5b26
Java Identifiers, Reserved Keywords And Control Statements | by Shweta Lokhande | Medium
June 8, 2021 - A Keyword is that which have a special meaning those already explained to the java language like int, float, class, public, etc. these are the reserved keywords. These special words cannot be used as class names, variables, or method names, because they have special meaning within the language.
🌐
Tpoint Tech
tpointtech.com › java-reserved-keywords
Java Reserved Keywords - Tpoint Tech
Keywords are reserved words in Java that serve as a code key. These words can't be used for anything else because they're predefined. They can't be used as a...
🌐
Intellipaat
intellipaat.com › home › blog › java keywords: complete guide to java reserved words
Java Keywords: Complete Guide to Java Reserved Words
October 26, 2025 - In Java, keywords are reserved words that have meanings assigned to them by the compiler. Java keywords act like commands that stand for something in Java. ... If the user were to use a keyword incorrectly and name a variable int or class, it ...