Transcript text: Identifiers
Rules for identifiers A name created by a programmer for an item like a variable or method is called an identifier. An identifier must: - be a sequence of letters (a-z, A-Z), underscore $(-)$, dollar signs $(\$)$, and digits (0-9) - start with a letter, underscore, or dollar sign
Note that " - , called an underscore, and " $\$$ ", called a dollar sign or currency symbol, are considered to be letters. A good practice followed by many Java programmers is to not use _ or \$ in programmer-created identifiers. Identifiers are case sensitive, meaning upper and lower case letters differ. So numCats and NumCats are different. A reserved word is a word that is part of the language, like int, short, or double. A reserved word is also known as a keyword. A programmer cannot use a reserved word as an identifier. Many language editors will automatically color a program's reserved words. A list of reserved words appears at the end of this section.
Check if the following identifiers are valid: $c$, cat, $n 1 \mathrm{m1}$, short1, hello, 42 c , hi there, and cat!