Understanding Variables

In this section, you will learn to declare variables.

A variable is a place holder.

You can store a value like 100 in a variable. After you store a value in the variable, you can store a different value in the variable whenever you want.

When you store a new value in a variable, the old value is no longer there. In other words, the old value is replaced by the new value.

A variable’s value can change when your program is running.

The value you can store in a variable is not necessarily a number. For example, you can create a variable that always stores a character. The kind of value that’s stored in a variable is known as a variable’s type.

You can refer the value stored in a variable using a variable’s name.