Java's Primitive Types

booleaneither true or false
char16-bit Unicode 1.1.5 character
byte8-bit signed two's-complement integer
short16-bit signed two's-complement integer
int32-bit signed two's-complement integer
long64-bit signed two's-complement integer
float32-bit IEEE 754-1985 floating-point number
double64-bit IEEE 754-1985 floating-point number

short and byte are always promoted to int before being evaluated. They are only stored, never operated upon.

MIN_VALUE = minimum value pre-defined for the type concerned
MAX_VALUE = maximum value pre-defined for the type concerned
float and double can also have stored values of:

NaN means 'not a number'. It indicates that the number is an invalid result such as the result of dividing by zero. This can be tested for by the method (function) isNan().


This page's parent within this Web Site. About this Web Site. Its home page. Email its Author.