Packages  This Package  Prev  Next  Index  

§1.11 Class Number

public  abstract class  java.lang.Number
    extends  java.lang.Object  (I-§1.12)
{
        // Methods
    public abstract double doubleValue();	§1.11.1
    public abstract float floatValue();	§1.11.2
    public abstract int intValue();	§1.11.3
    public abstract long longValue();	§1.11.4
}
The abstract class Number is the superclass of classes Float (I-§1.7), Double (I-§1.6), Integer (I-§1.8), and Long (I-§1.9).

Subclasses of Number must provide methods to convert the represented numeric value to int, long, float, and double.


Methods

doubleValue

public abstract double doubleValue()
Returns:
The numeric value represented by this object is returned after conversion to type double.

floatValue

public abstract float floatValue()
Returns:
The numeric value represented by this object is returned after conversion to type float.

intValue

public abstract int intValue()
Returns:
The numeric value represented by this object is returned after conversion to type int.

longValue

public abstract long longValue()
Returns:
The numeric value represented by this object is returned after conversion to type long.

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com