Number类源码:
public abstract class Number implements java.io.Serializable {
public abstract int intValue();
public abstract long longValue();
public abstract float floatValue();
public abstract double doubleValue();
public byte byteValue() {
return (byte)intValue();
}
public short shortValue() {
return (short)intValue();
}
private static final long serialVersionUID = -8742448824652078965L;
}
抽象类 Number
是 BigDecimal
、BigInteger
、Byte
、Double
、Float
、Integer
、Long
和 Short
类的超类。
Number
的子类必须提供将表示的数值转换为 byte
、double
、float
、int
、long
和 short
的方法。
serialVersionUID 串行化版本统一标识符,用来确定序列化后对象版本唯一,不会随着类定义的改变而变得不能读取。