Skip to content

Boxes with names

Read · 1 of 5

A variable is a named box

int apples = 5; makes a box called apples that can hold whole numbers, and puts 5 in it.

Later you can read what's in the box, or put something new in it. The box keeps only the latest value.