Java's Primitive Data Types |
Name |
Size |
Min. Value |
Max. Value |
boolean
|
1 bit |
- |
- |
byte |
1 byte |
-128 |
127 |
char
|
2 bytes |
0 |
65535 |
short |
2 bytes |
-32768 |
32767 |
int |
4 bytes |
-2147483648 |
2147483647 |
float |
4 bytes |
-3.4 x 10E38 |
3.4 x 10E38 |
long |
8 bytes |
-9223372036854775808 |
9223372036854775807 |
double |
8 bytes |
-1.8 x 10E308 |
1.8 x 10E308 |
In the result of an operation, the data type is an int or the widest operand, whichever is wider. Therefore the result of any arithmetic operation will never be a byte, short or char, even though they may be the only data types in the operation.
|
To add an entry or request an existing one to be altered, please fill in the comments form
Return to Top
About Java
Main Index
(c) Compiled by B V Wood.
|
|
|
Main Index
UK SPONSERS
USA SPONSERS
|
|