Java Identifiers That You (the Programmer) Declare

By Barry A. Burd

Part of Beginning Programming with Java For Dummies Cheat Sheet

In your own Java program, you can make up names to your heart’s delight. For example, in the code

double multiplyByTwo(double myValue) {

return myValue * 2;

}

the names multiplyByTwo and myValue are your very own identifiers.

When you create a new name, you can use letters, digits, underscores (_), and dollar signs ($). But don’t start the name with a digit. If you try to start a name with a digit, Java replies with a “Please don’t do that” message.