float

The float keyword is used to declare a primitive Java data type containing a 32-bit floating-point number represented in IEEE 754 format. Variables of type double store values in the range positive 3.40282347E+38 to negative 1.40239846E-45. When you want a floating-point literal value to be treated as a float, append the letters 'f' or 'F' to the end of the value.

The following example demonstrates declaration and assignment for a float variable:

float fCalcSet;

fCalcSet = 1.23f;
fCalcSet = 3e2f;
fCalcSet = .25f;