Module java.base
Package java.lang

Class Float

java.lang.Object
java.lang.Number
java.lang.Float
All Implemented Interfaces:
Serializable,Comparable<Float>,Constable,ConstantDesc

public final classFloatextendsNumberimplementsComparable<Float>,Constable,ConstantDesc
TheFloat class wraps a value of primitive typefloat in an object. An object of typeFloat contains a single field whose type isfloat.

In addition, this class provides several methods for converting afloat to aString and aString to afloat, as well as other constants and methods useful when dealing with afloat.

This is avalue-based class; programmers should treat instances that areequal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail.

Floating-point Equality, Equivalence, and Comparison

The classjava.lang.Double has adiscussion of equality, equivalence, and comparison of floating-point values that is equally applicable tofloat values.

Decimal ↔ Binary Conversion Issues

Thediscussion of binary to decimal conversion issues injava.lang.Double is also applicable tofloat values.
Since:
1.0
See Also: