March 2005
Beginner to intermediate
1254 pages
104h 21m
English
Float
This class provides an immutable object
wrapper around a primitive float value.
floatValue( ) returns the primitive
float value of a Float object,
and there are methods for returning the value of a
Float as a variety of other primitive types. This
class is very similar to Double, and defines the
same set of useful methods and constants as that class does. See
Double for details.
Figure 10-23. java.lang.Float
public final class Float extends Number implements Comparable<Float> { // Public Constructors public Float(double value); public Float(String s) throws NumberFormatException; public Float(float value); // Public Constants public static final float MAX_VALUE; =3.4028235E38 public static final float MIN_VALUE; =1.4E-45 public static final float NaN; =NaN public static final float NEGATIVE_INFINITY; =-Infinity public static final float POSITIVE_INFINITY; =Infinity 5.0 public static final int SIZE; =32 1.1 public static final Class<Float> TYPE; // Public Class Methods 1.4 public static int compare(float f1, float f2); public static int floatToIntBits(float value); native 1.3 public static int floatToRawIntBits(float value); native public static float intBitsToFloat(int bits); native public static boolean isInfinite(float v); public static boolean isNaN(float v); 1.2 public static float parseFloat(String s) throws NumberFormatException; 5.0 public static ...
Read now
Unlock full access