A primitive type is predefined by the language and is named by a reserved keyword. Primitive values do not share state with other primitive values. The eight primitive data types supported by the Java programming language are:
Type
|
Bit size
|
Range
|
Default value
|
byte
|
8-bit
|
f -128 and a maximum value of 127 (inclusive)
|
0
|
short
|
16-bit
|
-32,768 and a maximum value of 32,767
|
0
|
int
|
32-bit
|
-231 and a
maximum value of 231-1.
|
0
|
long
|
64-bit
|
-263 and a
maximum value of 263-1
|
0
|
float
|
32-bit IEEE 754 floating poin
|
|
0.0f
|
double
|
64-bit IEEE 754 floating poin
|
|
0.0d
|
boolean
|
|
True,false
|
false
|
char
|
6-bit Unicode character
|
minimum value of
'\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive |
'\u0000'
|
No comments:
Post a Comment