Computer Science, asked by nishu211, 1 year ago

what are the rules for naming variables

Answers

Answered by SandeepSinghrajp
8
All variable names must begin with a letter of the alphabet, an underscore, or ( _ ), or a dollar sign ($). The convention is to always use a letter of the alphabet. The dollar sign and the underscore are discouraged. After the first initial letter, variable names may also contain letters and the digits 0 to 9.
Answered by ABHAYSTAR
7
Hi,

After the first initial letter, variable names may also contain letters and the digits 0 to 9. ...

The name can be of any length, but don't get carried away. ...

Uppercase characters are distinct from lowercase characters. ...

You cannot use a java keyword (reserved word) for a variable name.

:-) Hope it helps....
Similar questions