> For the complete documentation index, see [llms.txt](https://www.computersciencea.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.computersciencea.com/unit-1-using-objects-and-methods/1.2-variables-and-data-types.md).

# 1.2 Variables and Data Types

#### Topic 1.2 — Variables and Data Types

**Suggested Skills:** 1.A, 2.A

**LO 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 used 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.

**LO 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** — The other five primitive data types (`long`, `short`, `byte`, `float`, and `char`) are outside the scope of this 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.computersciencea.com/unit-1-using-objects-and-methods/1.2-variables-and-data-types.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
