The words that have predefined meaning in java or the other words whose meaning is reserved in java are called keywords.
The keywords of java language must be specified in lowercase only.
The values that we store into a variable are called as literals.
Any name that is used for the purpose of identification is called identifier.
Keyword/ datatype Identifier/Variable Literal data/value
int age = 23
Rules for Writing an Identifier
- An identifier can be a combination of alphabets, digits, underscore(_) and dollars($)
- An identifier must not begin with a digit. It can begin with either an alphabet or underscore or dollar
- Identifier should not contains any spaces
- The keyword of java language should not be used as identifier
- There is no restriction on the length of identifier, but it is recommended to write an identifier having not more than 16 characters
- The name of the identifier should be meaningful and appropriate to the application.
int x= 23; valid but not recommended
int custid=23; valid and recommended