Chapter 5 Variables and Constants
5.1 What is a Variable?
In computer science, a variable is a location in the computer's main memory (RAM) where a program can store a value and change it as the program executes.
Picture a variable as a transparent box in which you can insert and hold one thing at a time. Because the box is transparent, you can also see what it contains. Also, if you have two or more boxes you can give each box a unique name. For example, you could have three boxes, each containing a different number, and you could name the boxes numberA, numberB, and numberC.
The boxes named numberA, numberB and numberC in the example contain ...
Get Java and Algorithmic Thinking for the Complete Beginner now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.