Describe the primitive types and range of values associated with each type.
Java variables may store the values of primitive types or references to objects. Java supports the following eight primitive types:
boolean - Consists of the
byte - Supports 8-bit integer values from -128 to 127.
char - Supports 16-bit Unicode characters whose values range from 0 to 216 - 1.
short - Supports 16-bit integer values whose values range from -(215) to 215 - 1.
int - Supports 32-bit integer values whose values range from -(231) to 231 - 1.
long - Supports 64-bit integer values whose values range from -(263) to 263 - 1.
float - Supports 32-bit floating point values whose values range from
It also includes the values
Float.NaN (not a number),
double - Supports 64-bit floating point values whose values range from
It also includes the value
Double.NaN (not a number),
Remember the ranges of each of the primitive types. You will see questions on the certification exam that test your knowledge of them.