Most visited

Recently visited

Added in API level 1

Number

public abstract class Number
extends Object implements Serializable

java.lang.Object
   ↳ java.lang.Number
Known Direct Subclasses


抽象类 Number是类超 BigDecimal , BigInteger , Byte , Double , Float , Integer , Long ,并 Short 。

的子类 Number必须提供方法为代表的数值转换为 byte , double , float , int , long ,并 short 。

也可以看看:

Summary

Public constructors

Number()

Public methods

byte byteValue()

以 byte返回指定数字的值。

abstract double doubleValue()

以 double返回指定数字的值。

abstract float floatValue()

以 float返回指定数字的值。

abstract int intValue()

以 int返回指定数字的 int 。

abstract long longValue()

以 long返回指定数字的值。

short shortValue()

以 short返回指定数字的值。

Inherited methods

From class java.lang.Object

Public constructors

Number

Added in API level 1
Number ()

Public methods

byteValue

Added in API level 1
byte byteValue ()

以byte返回指定数字的值。 这可能涉及四舍五入或截断。

Returns
byte the numeric value represented by this object after conversion to type byte.

doubleValue

Added in API level 1
double doubleValue ()

以double返回指定数字的值。 这可能涉及四舍五入。

Returns
double the numeric value represented by this object after conversion to type double.

floatValue

Added in API level 1
float floatValue ()

以float返回指定数字的值。 这可能涉及四舍五入。

Returns
float the numeric value represented by this object after conversion to type float.

intValue

Added in API level 1
int intValue ()

以int返回指定数字的int 。 这可能涉及四舍五入或截断。

Returns
int the numeric value represented by this object after conversion to type int.

longValue

Added in API level 1
long longValue ()

以long返回指定数字的值。 这可能涉及四舍五入或截断。

Returns
long the numeric value represented by this object after conversion to type long.

shortValue

Added in API level 1
short shortValue ()

以short返回指定数字的值。 这可能涉及四舍五入或截断。

Returns
short the numeric value represented by this object after conversion to type short.

Hooray!