English 中文(简体)
Java.lang - Number
  • 时间:2024-09-17

Java.lang.Number Class


Previous Page Next Page  

The java.lang.Number class is the superclass of classes BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, and Short.The Subclasses of Number must provide methods to convert the represented numeric value to byte, double, float, int, long, and short.

Class Constructors

Following is the constructor of this class −

Sr.No.

Constructor & Description

1

Number()

This is the Single Constructor that is called by the subclasses.

Class Methods

Following is the pst of methods of the Number class −

Sr.No.

Method & Description

1

byteValue()

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

2

doubleValue()

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

3

floatValue()

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

4

intValue()

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

5

longValue()

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

Advertisements