Computer Applications
Answer
The rules to be followed while naming a variable in Java programming are as follows:
- A variable may have any number of characters.
- It may contain letters, digits and a underscore.
- It must not start with a digit or special character.
- It must not contain spaces, punctuation marks or any symbol.
- The underscore can be inserted in between the characters to separate the words, in case a variable includes multiple words.
- Variable name should be meaningful which specifies what it represents.