Identifiers and keywords are terms used in computer programming languages.
Identifiers are names given to variables, functions, objects, classes, and other elements in a program. They help developers refer to these elements throughout the code, making it easier to read and understand. Identifiers follow specific rules, such as beginning with a letter or underscore, being case-sensitive, and avoiding reserved words or keywords.
Rules for Forming Identifiers:
They must begin with a letter or underscore (_), but not a number. They can contain letters, numbers, and underscores. They are case-sensitive. They cannot be a keyword or reserved word in the programming language.
- They must begin with a letter or underscore (_), but not a number.
- They can contain letters, numbers, and underscores.
- They are case-sensitive.
- They cannot be a keyword or reserved word in the programming language.
Keywords:
Keywords are reserved phrases in a programming language which have a selected meaning and cannot be used as identifiers (variable names, feature names, and so on.). Here are a few not unusual keywords in programming languages:
- if, else, while, for: used on top of things flow statements.
- Int, flow, bool, string: used to claim information sorts.
- Function, elegance, go back: used to define features and instructions.
- Public, private, covered: utilized in object-orientated programming for access modifiers.
- Proper, fake: used to represent boolean values.