FileDocCategorySizeDatePackage
Number.javaAPI DocJava SE 5 API3072Fri Aug 26 14:57:04 BST 2005java.lang

Number

public abstract class Number extends Object implements 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.

author
Lee Boynton
author
Arthur van Hoff
version
1.29, 12/19/03
see
java.lang.Byte
see
java.lang.Double
see
java.lang.Float
see
java.lang.Integer
see
java.lang.Long
see
java.lang.Short
since
JDK1.0

Fields Summary
private static final long
serialVersionUID
use serialVersionUID from JDK 1.0.2 for interoperability
Constructors Summary
Methods Summary
public bytebyteValue()
Returns the value of the specified number as a byte. This may involve rounding or truncation.

return
the numeric value represented by this object after conversion to type byte.
since
JDK1.1

	return (byte)intValue();
    
public abstract doubledoubleValue()
Returns the value of the specified number as a double. This may involve rounding.

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

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

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

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

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

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

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

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

return
the numeric value represented by this object after conversion to type short.
since
JDK1.1

	return (short)intValue();