# Number

public abstract class **Number** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [Serializable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Serializable.html)

|---|---|---|
| Known Direct Subclasses [AtomicInteger](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/AtomicInteger.html), [AtomicLong](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/AtomicLong.html), [Byte](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Byte.html), [Double](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Double.html), [DoubleAccumulator](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/DoubleAccumulator.html), [DoubleAdder](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/DoubleAdder.html), [Float](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Float.html), [Integer](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Integer.html), [Long](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Long.html), [LongAccumulator](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/LongAccumulator.html), [LongAdder](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/LongAdder.html), [Short](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Short.html) |---|---| | [AtomicInteger](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/AtomicInteger.html) | An `int` value that may be updated atomically. | | [AtomicLong](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/AtomicLong.html) | A `long` value that may be updated atomically. | | [Byte](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Byte.html) | The `Byte` class wraps a value of primitive type `byte` in an object. | | [Double](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Double.html) | The `Double` class wraps a value of the primitive type `double` in an object. | | [DoubleAccumulator](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/DoubleAccumulator.html) | One or more variables that together maintain a running `double` value updated using a supplied function. | | [DoubleAdder](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/DoubleAdder.html) | One or more variables that together maintain an initially zero `double` sum. | | [Float](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Float.html) | The `Float` class wraps a value of primitive type `float` in an object. | | [Integer](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Integer.html) | The `Integer` class wraps a value of the primitive type `int` in an object. | | [Long](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Long.html) | The `Long` class wraps a value of the primitive type `long` in an object. | | [LongAccumulator](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/LongAccumulator.html) | One or more variables that together maintain a running `long` value updated using a supplied function. | | [LongAdder](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/concurrent/atomic/LongAdder.html) | One or more variables that together maintain an initially zero `long` sum. | | [Short](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Short.html) | The `Short` class wraps a value of primitive type `short` in an object. | |||

The abstract class `Number` is the superclass of platform
classes representing numeric values that are convertible to the
primitive types `byte`, `double`, `float`, `int`, `long`, and `short`.

The specific semantics of the conversion from the numeric value of
a particular `Number` implementation to a given primitive
type is defined by the `Number` implementation in question.

For platform classes, the conversion is often analogous to a
narrowing primitive conversion or a widening primitive conversion
as defining in The Java™ Language Specification
for converting between primitive types. Therefore, conversions may
lose information about the overall magnitude of a numeric value, may
lose precision, and may even return a result of a different sign
than the input.

See the documentation of a given `Number` implementation for
conversion details.

### Public Constructor Summary

|---|---|
|   | [Number](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#Number())() |

### Public Method Summary

|---|---|
| byte | [byteValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#byteValue())() Returns the value of the specified number as a `byte`, which may involve rounding or truncation. |
| abstract double | [doubleValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#doubleValue())() Returns the value of the specified number as a `double`, which may involve rounding. |
| abstract float | [floatValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#floatValue())() Returns the value of the specified number as a `float`, which may involve rounding. |
| abstract int | [intValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#intValue())() Returns the value of the specified number as an `int`, which may involve rounding or truncation. |
| abstract long | [longValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#longValue())() Returns the value of the specified number as a `long`, which may involve rounding or truncation. |
| short | [shortValue](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#shortValue())() Returns the value of the specified number as a `short`, which may involve rounding or truncation. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**Number**
()

<br />

## Public Methods

#### public byte
**byteValue**
()

Returns the value of the specified number as a `byte`,
which may involve rounding or truncation.

This implementation returns the result of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#intValue()` cast
to a `byte`.

##### Returns

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

#### public abstract double
**doubleValue**
()

Returns the value of the specified number as a `double`,
which may involve rounding.

##### Returns

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

#### public abstract float
**floatValue**
()

Returns the value of the specified number as a `float`,
which may involve rounding.

##### Returns

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

#### public abstract int
**intValue**
()

Returns the value of the specified number as an `int`,
which may involve rounding or truncation.

##### Returns

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

#### public abstract long
**longValue**
()

Returns the value of the specified number as a `long`,
which may involve rounding or truncation.

##### Returns

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

#### public short
**shortValue**
()

Returns the value of the specified number as a `short`,
which may involve rounding or truncation.

This implementation returns the result of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Number.html#intValue()` cast
to a `short`.

##### Returns

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