Variables and Data Types

Discover what a variable is and what data types it can have.

What is a variable?

Imagine that you have several objects that need to be stored in boxes. Each box can only store one object, and to keep track of which box contains which item, you label each box with a unique name. A variable is just like the box, except that it resides in computer memory. A variable stores a value and has a name to identify it.

Get hands-on with 1200+ tech skills courses.