Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Hour 5. Storing and Changing Information in a Program

In Hour 2, "Writing Your First Program," you used a variable, a special storage place that is used to hold information. The information stored in variables can be changed as your program runs, which is why they're called variables.

Your first program stored a string of text in a variable called greeting. Strings are only one type of information that can be stored in variables. They can also hold characters, integers, floating-point numbers, and other things.

During this hour, you'll learn more about using variables in your Java programs, including the following topics:

Share ThisShare This

Informit Network