Beginning Programming with Java For Dummies, 6th Edition
Book image
Explore Book Buy On Amazon
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.

About This Article

This article is from the book:

About the book author:

Barry Burd, PhD, is a veteran author and educator. At the University of Illinois, he was named five times to the university-wide List of Teachers Ranked as Excellent by their Students. He has written several books on Java and Android development.

This article can be found in the category: