Rules for Naming an Identifier

  1. Identifiers cannot be a keyword.
  2. Identifiers are case-sensitive.
  3. It can have a sequence of letters and digits. However, it must begin with a letter, $ or _. The first letter of an identifier cannot be a digit.
  4. It's a convention to start an identifier with a letter rather and $ or _.
  5. Whitespaces are not allowed.
  6. Similarly, you cannot use symbols such as , #, and so on.

Here are few valid and invalid identifiers.

Valid
score
level
highestScore
number1
convertToString

Invaid
class
float
1number
highest Score
@pple