Most visited

Recently visited

Added in API level 1

Number

public abstract class Number
extends Object implements Serializable

java.lang.Object
   ↳ java.lang.Number
Known Direct Subclasses


The abstract class Number is the superclass of classes BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, and Short.

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

See also:

Summary

Public constructors

Number()

Public methods

byte byteValue()

Returns the value of the specified number as a byte.

abstract double doubleValue()

Returns the value of the specified number as a double.

abstract float floatValue()

Returns the value of the specified number as a float.

abstract int intValue()

Returns the value of the specified number as an int.

abstract long longValue()

Returns the value of the specified number as a long.

short shortValue()

Returns the value of the specified number as a short.

Inherited methods

From class java.lang.Object

Public constructors

Number

Added in API level 1
Number ()

Public methods

byteValue

Added in API level 1
byte byteValue ()

Returns the value of the specified number as a byte. This may involve rounding or truncation.

Returns
byte the numeric value represented by this object after conversion to type byte.

doubleValue

Added in API level 1
double doubleValue ()

Returns the value of the specified number as a double. This may involve rounding.

Returns
double the numeric value represented by this object after conversion to type double.

floatValue

Added in API level 1
float floatValue ()

Returns the value of the specified number as a float. This may involve rounding.

Returns
float the numeric value represented by this object after conversion to type float.

intValue

Added in API level 1
int intValue ()

Returns the value of the specified number as an int. This may involve rounding or truncation.

Returns
int the numeric value represented by this object after conversion to type int.

longValue

Added in API level 1
long longValue ()

Returns the value of the specified number as a long. This may involve rounding or truncation.

Returns
long the numeric value represented by this object after conversion to type long.

shortValue

Added in API level 1
short shortValue ()

Returns the value of the specified number as a short. This may involve rounding or truncation.

Returns
short the numeric value represented by this object after conversion to type short.

Hooray!