java.lang.Object | |
↳ | java.lang.Number |
The abstract class Number
is the superclass of classes
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
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
byte |
byteValue()
Returns the value of the specified number as a
byte . | ||||||||||
abstract double |
doubleValue()
Returns the value of the specified number as a
double . | ||||||||||
abstract float |
floatValue()
Returns the value of the specified number as a
float . | ||||||||||
abstract int |
intValue()
Returns the value of the specified number as an
int . | ||||||||||
abstract long |
longValue()
Returns the value of the specified number as a
long . | ||||||||||
short |
shortValue()
Returns the value of the specified number as a
short . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns the value of the specified number as a byte
. This may
involve rounding or truncation.
byte
.
Returns the value of the specified number as a double
. This may
involve rounding.
double
.
Returns the value of the specified number as a float
. This may
involve rounding.
float
.
Returns the value of the specified number as an int
. This may
involve rounding or truncation.
int
.
Returns the value of the specified number as a long
. This may
involve rounding or truncation.
long
.
Returns the value of the specified number as a short
. This may
involve rounding or truncation.
short
.