answersLogoWhite

0

A variable in java is something that holds a value and has a name attached to it. This value can change and hence its named a variable.

There are two types of variables in Java:

• Primitives - A primitive variable can be one of eight types: char, boolean, byte, short, int, long, double, or float. Once a primitive has been declared, its primitive type can never change, although in most cases its value can change.

• Reference variables - A reference variable is used to refer to (or access) an object. A reference variable is declared to be of a specific type and that type can never be changed.

User Avatar

Wiki User

14y ago

What else can I help you with?