Normally in dealing with primitive type float we test equality by using == operators. This will no longer true if we are dealing with Float wrapper class because inherently to test two object equality we have to use the equals which is by default being inherited by all java objects from class Object.
Float f1 = 3.12f;
Float f2 = 3.12f;
Normally if the above code declaration uses float primitive type, the result would be true however since the float value 3.12f is assigned to wrapper class Float, it would print out false. If we wanted to use the == operator instead of equals, then we need to convert the Float values using the floatValue() method of Float class.
f1.floatValue() == f2.floatValue()
The above code snippet would result to true.