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
.
Number | |||||||||||||||||||||
| | |||||||||||||||||||||
| | - | - | Byte | ||||||||||||||||||
| | |||||||||||||||||||||
| | - | - | Short | ||||||||||||||||||
| | |||||||||||||||||||||
| | - | - | Integer | ||||||||||||||||||
| | |||||||||||||||||||||
| | - | - | Long | ||||||||||||||||||
| | |||||||||||||||||||||
| | - | - | Float | ||||||||||||||||||
| | |||||||||||||||||||||
| | - | - | Double | ||||||||||||||||||
The declaration of Number class is:
public abstract class Number
extends Object
implements Serializable
Methods from Number class
Return | Method | Summary |
---|---|---|
byte | byteValue() | Returns the value as a byte. |
abstract double | doubleValue() | Returns the value as a double. |
abstract float | floatValue() | Returns the value as a float. |
abstract int | intValue() | Returns the value as an int. |
abstract long | longValue() | Returns the value as a long. |
short | shortValue() | Returns the value as a short. |
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |