
42 CHAPTER 2 Programming Building Blocks—Java Basics
Introduction
If you boil it down to the basics, a program has two elements: instructions
and data. The instructions tell the CPU what to do with the data.
The data may be different in each execution of the program, but the instruc-
tions stay the same. In a word processor, the words (data) are different from
document to document, but the operation (instructions) of the word
processor remains the same. When a line becomes full, for example, the word
processor automatically wraps to the next line. It doesn’t matter which words
are on the line, only that the line is full. When you select a word and c ...