Primitive Data Types
Primitive data types refer to a single piece of data (such as an integer or a character). Primitive data types are sometimes called atomic because they can’t be broken down any further.
Perhaps the most important data type is the Boolean. The Boolean (named after George Boole, an English mathematician) is the simplest type of data:
0, on or off, yes or no, true or false. All the logic that happens within a computer program depends on the Boolean data type. In Chapter 7, “
While, and When,” you learn all about
if statements and
while statements and how to use Booleans to control how your program works. Try out the code in Listing 5.2 to see Booleans in action. For more on how to try out code, take a look ...