Class: java.lang.Number
- public abstract class Number
- 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.
Methods
-
Numbertop
public Number() -
byteValuetop
public byte byteValue()Returns the value of the specified number as abyte. This may involve rounding or truncation. -
doubleValuetop
public abstract double doubleValue()Returns the value of the specified number as adouble. This may involve rounding. -
floatValuetop
public abstract float floatValue()Returns the value of the specified number as afloat. This may involve rounding. -
intValuetop
public abstract int intValue()Returns the value of the specified number as anint. This may involve rounding or truncation. -
longValuetop
public abstract long longValue()Returns the value of the specified number as along. This may involve rounding or truncation. -
shortValuetop
public short shortValue()Returns the value of the specified number as ashort. This may involve rounding or truncation.
