2. 10. 1. Floating-Point Data Types: memory and length |
|
Type float and type double are two primitive floating-point types in Java. |
Data Type | Description | Memory | float | -3.4E38 to +3.4E38 | 4 bytes in memory | double | -1.7E308 to +1.7E308 | 8 bytes in memory |
|
Examples of float literals include the following: |
2elf
8.f
.5f
0f
3.14f
9.0001e+12f
|
|
Here are examples of double literals. |
2el
8.
.5
0.0D
3.14
9e-9d
7e123D
|
|