1.2 Variables and Data Types

Learning Objective
Essential Knowledge

1.2.A Identify the most appropriate data type category for a particular specification.

1.2.A.1 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.

1.2.A.2 The primitive data types in this course define the set of values and corresponding operations on those values for numbers and Boolean values.

1.2.A.3 A reference type is used to define objects that are not primitive types.

1.2.B Develop code to declare variables to store numbers and Boolean values.

1.2.B.1 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.

Exclusion Statement: The other five primitive data types (long, short, byte, float and char) are outside the scope of the AP Computer Science A course and exam.

1.2.B.2 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.

Suggested Skills

1.A Determine an appropriate program design to solve a problem or accomplish a task

2.A Write program code to implement an algorithm

Last updated

Was this helpful?