Primitive Data Types
Learn about the different primitive data types.
We'll cover the following...
Primitive data types
Every variable has both a name and a type. The type defines what kind of data can be stored in the variable. Typically, a language will have some built-in types, called primitive (or basic) types, to handle a single value.
Primitive types can be divided into two categories:
- Boolean
- Numeric
Boolean type
Previously, we talked about George Boole and his Boolean algebra. This defined how we can combine values of true and false with AND, OR, and NOT. To be able to use these values in our programs, we have a type that is named after Boole, called the Boolean type. A variable that uses this type can only have one of two values—true or false. For languages that have these types, we use the actual words “true” ...