java.lang
Class Number

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Number
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable
Direct Known Subclasses:
AtomicInteger sample code for java.util.concurrent.atomic.AtomicInteger definition code for java.util.concurrent.atomic.AtomicInteger , AtomicLong sample code for java.util.concurrent.atomic.AtomicLong definition code for java.util.concurrent.atomic.AtomicLong , BigDecimal sample code for java.math.BigDecimal definition code for java.math.BigDecimal , BigInteger sample code for java.math.BigInteger definition code for java.math.BigInteger , Byte sample code for java.lang.Byte definition code for java.lang.Byte , Double sample code for java.lang.Double definition code for java.lang.Double , Float sample code for java.lang.Float definition code for java.lang.Float , Integer sample code for java.lang.Integer definition code for java.lang.Integer , Long sample code for java.lang.Long definition code for java.lang.Long , Short sample code for java.lang.Short definition code for java.lang.Short

public abstract class Number
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

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.

Since:
JDK1.0
See Also:
Byte sample code for java.lang.Byte definition code for java.lang.Byte , Double sample code for java.lang.Double definition code for java.lang.Double , Float sample code for java.lang.Float definition code for java.lang.Float , Integer sample code for java.lang.Integer definition code for java.lang.Integer , Long sample code for java.lang.Long definition code for java.lang.Long , Short sample code for java.lang.Short definition code for java.lang.Short , Serialized Form

Constructor Summary
Number sample code for java.lang.Number.Number() definition code for java.lang.Number.Number() ()
           
 
Method Summary
 byte byteValue sample code for java.lang.Number.byteValue() definition code for java.lang.Number.byteValue() ()
          Returns the value of the specified number as a byte.
abstract  double doubleValue sample code for java.lang.Number.doubleValue() definition code for java.lang.Number.doubleValue() ()
          Returns the value of the specified number as a double.
abstract  float floatValue sample code for java.lang.Number.floatValue() definition code for java.lang.Number.floatValue() ()
          Returns the value of the specified number as a float.
abstract  int intValue sample code for java.lang.Number.intValue() definition code for java.lang.Number.intValue() ()
          Returns the value of the specified number as an int.
abstract  long longValue sample code for java.lang.Number.longValue() definition code for java.lang.Number.longValue() ()
          Returns the value of the specified number as a long.
 short shortValue sample code for java.lang.Number.shortValue() definition code for java.lang.Number.shortValue() ()
          Returns the value of the specified number as a short.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

Number sample code for java.lang.Number() definition code for java.lang.Number()

public Number()
Method Detail

intValue sample code for java.lang.Number.intValue() definition code for java.lang.Number.intValue()

public abstract int intValue()
Returns the value of the specified number as an int. This may involve rounding or truncation.

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

longValue sample code for java.lang.Number.longValue() definition code for java.lang.Number.longValue()

public abstract long longValue()
Returns the value of the specified number as a long. This may involve rounding or truncation.

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

floatValue sample code for java.lang.Number.floatValue() definition code for java.lang.Number.floatValue()

public abstract float floatValue()
Returns the value of the specified number as a float. This may involve rounding.

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

doubleValue sample code for java.lang.Number.doubleValue() definition code for java.lang.Number.doubleValue()

public abstract double doubleValue()
Returns the value of the specified number as a double. This may involve rounding.

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

byteValue sample code for java.lang.Number.byteValue() definition code for java.lang.Number.byteValue()

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

Returns:
the numeric value represented by this object after conversion to type byte.
Since:
JDK1.1

shortValue sample code for java.lang.Number.shortValue() definition code for java.lang.Number.shortValue()

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

Returns:
the numeric value represented by this object after conversion to type short.
Since:
JDK1.1