Numberpublic abstract class Number extends Object implements SerializableThe abstract superclass of the classes which represent numeric base types
(that is {@link Byte}, {@link Short}, {@link Integer}, {@link Long},
{@link Float}, and {@link Double}. |
Fields Summary |
---|
private static final long | serialVersionUID |
Constructors Summary |
---|
public Number()Empty default constructor.
|
Methods Summary |
---|
public byte | byteValue()Returns this object's value as a byte. Might involve rounding and/or
truncating the value, so it fits into a byte.
return (byte) intValue();
| public abstract double | doubleValue()Returns this object's value as a double. Might involve rounding.
| public abstract float | floatValue()Returns this object's value as a float. Might involve rounding.
| public abstract int | intValue()Returns this object's value as an int. Might involve rounding and/or
truncating the value, so it fits into an int.
| public abstract long | longValue()Returns this object's value as a long. Might involve rounding and/or
truncating the value, so it fits into a long.
| public short | shortValue()Returns this object's value as a short. Might involve rounding and/or
truncating the value, so it fits into a short.
return (short) intValue();
|
|