Definition:
A float is a Java data type which can store floating point numbers (i.e., numbers that can have a fractional part). Only 4 bytes are used to store float numbers giving a value range of -3.4028235E+38 to 3.4028235E+38.
A problem with the float (and double) data type is it suffers from rounding errors:
float rounding = 0.9f - 0.11f;
System.out.println(rounding);
gives the output of:
0.78999996
Use the BigDecimal class for precise calculations.
Note: float data types are not used unless memory is an issue and an application needs to store a lot of fractional numbers. The double is the default data type to use for storing fractional numbers.

