This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Actually, they have it in there, but not in the actual text, why I don't know. It took me a while to find as well. Anyway, you can find it in the glossary, but I'll just tell you the rules. All method/var names must begin with either a letter, $, or _ (underscore) and the rest of the var/method name can only contain letter, numbers, $ or _ It does not matter if you use upper or lowercase but you must be consistent as Java is case sensitive. ex. $5gf _fd_ f54
In real life you may need to know that an identifier is a sequence of Java letters and Java digits, the first of which must be a Java letter. If something is considered a letter or digit in a human language, you can probably use it in identifiers. This allows programmers to use identifiers in their programs that are written in their native languages. The currency symbols $, pound sign ('\u00a3') and yen sign ('\u00a5') are Java letters. See Character.isJavaIdentifierStart(char) and Character.isJavaIdentifierPart(char). Java letters from the first 128 Unicode characters are $ A-Z _ a-z
[ July 13, 2003: Message edited by: Marlene Miller ]
Hi Dean I guess that you are already aware of this but justincluding it for the sake of completeness Reserved words and keywords and true,false and null(constants) can not also be used as a valid identifier.