Reserved words, also known as keywords, are words in a programming language that have special meanings and are reserved for specific purposes. These words cannot be used as identifiers (such as variable names or function names) because they are already predefined and used by the language itself. The set of reserved words varies depending on the programming language. Here are some examples of reserved words in different programming languages:
- C/C++:
- if, else, while, do, for: Control flow statements
- int, char, float, double: Data types
- return: Used to exit a function and return a value
- Java:
- if, else, while, do, for: Control flow statements
- int, char, float, double: Data types
- return: Used to exit a method and return a value
- class, public, private: Keywords related to class and access modifiers
- Python:
- if, else, while, for: Control flow statements
- def, class: Used for defining functions and classes
- True, False, None: Boolean and null-like values
- JavaScript:
- if, else, while, for: Control flow statements
- var, let, const: Used to declare variables
- function, class: Keywords for defining functions and classes
- Ruby:
- if, else, while, do, for: Control flow statements
- def, class: Used for defining methods and classes
- true, false, nil: Boolean and null-like values
- PHP:
- if, else, while, do, for: Control flow statements
- function, class: Keywords for defining functions and classes
- true, false, null: Boolean and null-like values
These are just a few examples, and each programming language has its own set of reserved words. It’s important to become familiar with the reserved words of the language you are working with to avoid conflicts and errors in your code.
Annie Sanjana Answered question May 26, 2023

The words that are a part of the standard C language library are called reserved words. Those reserved words have special meaning and it is not possible to use them for any activity other than its intended functionality.
Example: void, return int.