Module java.base
Package java.lang

Class Number

java.lang.Object
java.lang.Number
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AtomicInteger,AtomicLong,BigDecimal,BigInteger,Byte,Double,DoubleAccumulator,DoubleAdder,Float,Integer,Long,LongAccumulator,LongAdder,Short

public abstract classNumberextendsObjectimplementsSerializable
The abstract classNumber is the superclass of platform classes representing numeric values that are convertible to the primitive typesbyte,double,float, int,long, andshort. The specific semantics of the conversion from the numeric value of a particularNumber implementation to a given primitive type is defined by theNumber implementation in question. For platform classes, the conversion is often analogous to a narrowing primitive conversion or a widening primitive conversion as defined inThe Java Language Specification for converting between primitive types. Therefore, conversions may lose information about the overall magnitude of a numeric value, may lose precision, and may even return a result of a different sign than the input. See the documentation of a givenNumber implementation for conversion details.
SeeJava Language Specification:
5.1.2 Widening Primitive Conversion
5.1.3 Narrowing Primitive Conversion
Since:
1.0
See Also: