Variables are used for storing data during program execution.
Depending on what data you need to store there are several kinds of data types. Java has eight types that are built into the language. These are called primitives . The integer (whole number) types are byte, short, int and long. The float and double types represent floating-point numbers (real numbers). The char type holds a Unicode character and the boolean type contains either a true or false value. Except for these primitive types, every other type in Java is represented by either a class, an interface or an array.
|Data Type||Size (bits)||Description ...|