A computer is a machine that follows a list of instructions called a program. An Android device is a computer and an app is a program.

A variable is a container inside the device. Each variable can contain a value such as a number or a piece of text. The value in a variable is not necessarily permanent. It can be replaced by a different value, hence the name “variable”. A big variable that can contain smaller variables inside it is called an object, and the smaller variables are the fields of the object.

The first value put into a variable is called the variable’s initial value, and putting it into the variable is called initializing the variable. For some variables, this happens without our having to write any instruction at all. For example, an integer variable (one that holds a whole number) will have a default value of 0 if the variable is a field of an object.

For other variables, we have to write an instruction to perform the initialization. If we don’t, the device will refuse to execute an app that attempts to use the value of the variable. For example, an integer variable that is not a field of an object has no default value.