Every variable or expression in Java has a type.
In Java, these types fall into exactly two categories:
- Basic types
- Class types
Variables of basic type have storage allocated of the correct size to hold a value of that type.
Variables of class type have storage allocated only to hold a reference to a value of that type.
References are essentially addresses and addresses are the same size regardless of the value to which they refer.