Use of simple data types should involve the creation of a program that declares a variable of type int, byte, short, char, long, double, float, or Boolean. Description of each variable follows:
Keyword |
Description |
Size/Format |
|
(integers) |
|
byte |
Byte-length integer |
8-bit two's complement |
short |
Short integer |
16-bit two's complement |
int |
Integer |
32-bit two's complement |
long |
Long integer |
64-bit two's complement |
|
(real numbers) |
|
float |
Single-precision floating point |
32-bit IEEE 754 |
double |
Double-precision floating point |
64-bit IEEE 754 |
|
(other types) |
|
char |
A single character |
16-bit Unicode character |
Boolean |
A Boolean value (true or false) |
true or false |