In This Chapter
• Create a variable
• Use different types of variables
• Store values in variables
• Use variables in mathematical expressions
• Store one variable’s value in another variable
• Increase and decrease a variable’s value
In Chapter 4, “Start Writing Java Programs,” you used a variable, a special storage place designed to hold information. The information stored in variables can be changed as a program runs. Your first program stored a string of text in a variable. Strings are only one type of information that can be stored in variables. They also can hold characters, integers, floating-point numbers, and objects.
During this chapter, you learn more about using variables in your Java programs. ...