Back to Primitive Types

Lesson PreviewLesson 2 of 7 in this unit

1.2 Variables and Data Types

Part of Primitive Types in AP® Computer Science A. Read the opening section, then create a free account for the full interactive lesson, practice, and progress tracking.

Variables and Data Types

Data is simply information. It can be anything: numbers, words, pictures or even sounds. For example, your age, your name, or the score in a game are all pieces of data.

A variable is just something we use to store a data; just like we use books to store text, we can use variables to store data. We can give a variable a value with the equals (=) sign.

Continue the full lesson in Stellar

Create a free account to unlock the remaining sections, checkpoints, course practice, and progress tracking for AP® Computer Science A.