RoboDOJO

Variables vs Objects

In Java, and most programming languages, a variable is a memory location referenced by an identifier, a.k.a. name. Variables are used to store data that can be modified. Therefore, all objects are variables while some variables are not objects. This is the same as rectanles and squares.

A variable may hold a primitive data type such as an int, double, or boolean. These variables are not objects.