HOME
Variables and Data Types
Learning Objectives
- Identify the most appropriate data type category for a particular specification.
- A data type is a set of values and a corresponding set of operations on those values. Data types can be categorized as either primitive or reference.
- The primitive data types used in this course define the set of values and corresponding operations on those values for numbers and Boolean values.
- A reference type is used to define objects that are not primitive types.
- Develop code to declare variables to store numbers and Boolean values.
- The three primitive data types used in this course are int, double, and boolean. An int value is an integer. A double value is a real number. A boolean value is either true or false.
- A variable is a storage location that holds a value, which can change while the program is running. Every variable has a name and an associated data type. A variable of a primitive type holds a primitive value from that type.
Previous Topic - Introduction to Algorithms, Programming and Compilers
Next Topic - Expressions and Output