Type float and type double are two primitive floating-point types in Java.
Data TypeDescriptionMemory
float-3.4E38 to +3.4E384 bytes in memory
double-1.7E308 to +1.7E3088 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