📜  Java.lang.Number类

📅  最后修改于: 2020-11-15 03:02:48             🧑  作者: Mango


介绍

java.lang.Number类是BigDecimal,BigInteger,Byte,Double,Float,Integer,Long和Short类的超类。Number的子类必须提供将表示的数值转换为byte,double,float,int的方法。 , 长和短。

类声明

以下是java.lang.Number类的声明-

public abstract class Number
   extends Object
      implements Serializable

类的构造函数

Sr.No. Constructor & Description
1

Number()

This is the Single Constructor.

类方法

Sr.No. Method & Description
1 byte byteValue()

This method returns the value of the specified number as a byte.

2 abstract double doubleValue()

This method returns the value of the specified number as a double.

3 abstract float floatValue()

This method returns the value of the specified number as a float.

4 abstract int intValue()

This method returns the value of the specified number as a int.

5 abstract long longValue()

This method returns the value of the specified number as a long.

6 short shortValue()

This method returns the value of the specified number as a short.

方法继承

此类从以下类继承方法-

  • java.lang.Object