Identifier is a name given to a class, variable, constant or method.
Rules for Declaring a Legal Identifier:
- Identifier must start with a letter, $, _. Cannot start with number.
- After the first letter, contain numeric.
- No Limit to the number of characters an identifier can contain.
- Cannot use keyword in identifier name.
- Identifiers are case-sensitive.
Example of legal identifiers
int _a;
int $count;
int ____ag_e;
int _$;
int detaild_name_for_identifier;
Example of illegal identifiers
int :a;
int -count;
int age#;
int .first;
int 3s;