Number
public
abstract
class
Number
extends Object
implements
Serializable
| java.lang.Object | |
| ↳ | java.lang.Number |
|
|
The abstract class Number is the superclass of classes
BigDecimal, BigInteger,
Byte, Double, Float,
Integer, Long, and Short.
Subclasses of Number must provide methods to convert
the represented numeric value to byte, double,
float, int, long, and
short.
Summary
Public constructors | |
|---|---|
Number()
|
|
Public methods | |
|---|---|
byte
|
byteValue()
Returns the value of the specified number as a |
abstract
double
|
doubleValue()
Returns the value of the specified number as a |
abstract
float
|
floatValue()
Returns the value of the specified number as a |
abstract
int
|
intValue()
Returns the value of the specified number as an |
abstract
long
|
longValue()
Returns the value of the specified number as a |
short
|
shortValue()
Returns the value of the specified number as a |
Inherited methods | |
|---|---|
java.lang.Object
| |
Public constructors
Public methods
byteValue
byte byteValue ()
Returns the value of the specified number as a byte.
This may involve rounding or truncation.
| Returns | |
|---|---|
byte |
the numeric value represented by this object after conversion
to type byte. |
doubleValue
double doubleValue ()
Returns the value of the specified number as a double.
This may involve rounding.
| Returns | |
|---|---|
double |
the numeric value represented by this object after conversion
to type double.
|
floatValue
float floatValue ()
Returns the value of the specified number as a float.
This may involve rounding.
| Returns | |
|---|---|
float |
the numeric value represented by this object after conversion
to type float.
|
intValue
int intValue ()
Returns the value of the specified number as an int.
This may involve rounding or truncation.
| Returns | |
|---|---|
int |
the numeric value represented by this object after conversion
to type int.
|
longValue
long longValue ()
Returns the value of the specified number as a long.
This may involve rounding or truncation.
| Returns | |
|---|---|
long |
the numeric value represented by this object after conversion
to type long.
|
shortValue
short shortValue ()
Returns the value of the specified number as a short.
This may involve rounding or truncation.
| Returns | |
|---|---|
short |
the numeric value represented by this object after conversion
to type short. |
Annotations
Interfaces
Classes
- Boolean
- Byte
- Character
- Character.Subset
- Character.UnicodeBlock
- Class
- ClassLoader
- Compiler
- Double
- Enum
- Float
- InheritableThreadLocal
- Integer
- Long
- Math
- Number
- Object
- Package
- Process
- ProcessBuilder
- Runtime
- RuntimePermission
- SecurityManager
- Short
- StackTraceElement
- StrictMath
- String
- StringBuffer
- StringBuilder
- System
- Thread
- ThreadGroup
- ThreadLocal
- Throwable
- Void
Enums
Exceptions
- ArithmeticException
- ArrayIndexOutOfBoundsException
- ArrayStoreException
- ClassCastException
- ClassNotFoundException
- CloneNotSupportedException
- EnumConstantNotPresentException
- Exception
- IllegalAccessException
- IllegalArgumentException
- IllegalMonitorStateException
- IllegalStateException
- IllegalThreadStateException
- IndexOutOfBoundsException
- InstantiationException
- InterruptedException
- NegativeArraySizeException
- NoSuchFieldException
- NoSuchMethodException
- NullPointerException
- NumberFormatException
- ReflectiveOperationException
- RuntimeException
- SecurityException
- StringIndexOutOfBoundsException
- TypeNotPresentException
- UnsupportedOperationException
Errors
- AbstractMethodError
- AssertionError
- ClassCircularityError
- ClassFormatError
- Error
- ExceptionInInitializerError
- IllegalAccessError
- IncompatibleClassChangeError
- InstantiationError
- InternalError
- LinkageError
- NoClassDefFoundError
- NoSuchFieldError
- NoSuchMethodError
- OutOfMemoryError
- StackOverflowError
- ThreadDeath
- UnknownError
- UnsatisfiedLinkError
- UnsupportedClassVersionError
- VerifyError
- VirtualMachineError

