Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.lang

Class Number

java.lang.Object
|
+--java.lang.Number

All Implemented Interfaces:

Serializable


public abstract class Number

extends Object

implements Serializable

Number is a generic superclass of all the numeric classes, including the wrapper classes Byte, Short, Integer, Long, Float, and Double. Also worth mentioning are the classes in java.math. It provides ways to convert numeric objects to any primitive.

Since:Authors:

Constructor Summary

Number()

The basic constructor (often called implicitly).

Method Summary

bytebyteValue()

Return the value of this Number as a byte.
doubledoubleValue()

Return the value of this Number as a float.
floatfloatValue()

Return the value of this Number as a float.
intintValue()

Return the value of this Number as an int.
longlongValue()

Return the value of this Number as a long.
shortshortValue()

Return the value of this Number as a short.

Constructor Details

Number

public Number()

The basic constructor (often called implicitly).


Method Details

byteValue

public byte byteValue()

Return the value of this Number as a byte.

Since:Returns:


doubleValue

public double doubleValue()

Return the value of this Number as a float.

Returns:


floatValue

public float floatValue()

Return the value of this Number as a float.

Returns:


intValue

public int intValue()

Return the value of this Number as an int.

Returns:


longValue

public long longValue()

Return the value of this Number as a long.

Returns:


shortValue

public short shortValue()

Return the value of this Number as a short.

Since:Returns: