java.lang
Class Number

java.lang.Object
  extended by java.lang.Number
Direct Known Subclasses:
Byte, Double, Float, Integer, Long, Short

public abstract class Number
extends Object

Number is a generic superclass of all the numeric classes, including the wrapper classes Byte, Short, Integer, Long, Float, and Double. Also worth mentioning are the classes in java.math. It provides ways to convert numeric objects to any primitive.

Since:
1.0

Constructor Summary
Number()
          The basic constructor (often called implicitly).
 
Method Summary
 byte byteValue()
          Return the value of this Number as a byte.
abstract  double doubleValue()
          Return the value of this Number as a float.
abstract  float floatValue()
          Return the value of this Number as a float.
abstract  int intValue()
          Return the value of this Number as an int.
abstract  long longValue()
          Return the value of this Number as a long.
 short shortValue()
          Return the value of this Number as a short.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Number

public Number()
The basic constructor (often called implicitly).

Method Detail

intValue

public abstract int intValue()
Return the value of this Number as an int.

Returns:
the int value

longValue

public abstract long longValue()
Return the value of this Number as a long.

Returns:
the long value

floatValue

public abstract float floatValue()
Return the value of this Number as a float.

Returns:
the float value

doubleValue

public abstract double doubleValue()
Return the value of this Number as a float.

Returns:
the double value

byteValue

public byte byteValue()
Return the value of this Number as a byte.

Returns:
the byte value
Since:
1.1

shortValue

public short shortValue()
Return the value of this Number as a short.

Returns:
the short value
Since:
1.1