Please enable JavaScript to use CodeHS

IB Computer Science Higher Level (Year One)

Lesson 6.2 Variables and Data Types

Description

In this lesson, students will learn about variables. Variables allow information to be stored such as numbers, words, or true/false expressions. A variable can be thought of as a box that stores information inside. In Java, variables are composed of three things: a name, type, and value. This lesson corresponds with AP Computer Science A topic 1.2.


Objective

Students will be able to:

  • declare, initialize and assign a value to a variable
  • identify the most appropriate data type category for a particular specification
  • categorize a data type as either primitive or reference
  • declare a final variable