public final class Short extends Object
Modifier and Type | Field and Description |
---|---|
static short |
MAX_VALUE
The maximum value a Short can have.
|
static short |
MIN_VALUE
The minimum value a Short can have.
|
Constructor and Description |
---|
Short(short value)
Constructs a Short object initialized to the specified short value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares this object to the specified object.
|
int |
hashCode()
Returns a hashcode for this Short.
|
static short |
parseShort(String s)
Assuming the specified String represents a short, returns
that short's value.
|
static short |
parseShort(String s,
int radix)
Assuming the specified String represents a short, returns
that short's value in the radix specified by the second
argument.
|
short |
shortValue()
Returns the value of this Short as a short.
|
String |
toString()
Returns a String object representing this Short's value.
|
public static final short MIN_VALUE
public static final short MAX_VALUE
public Short(short value)
value
- the initial value of the Shortpublic static short parseShort(String s) throws NumberFormatException
s
- the String containing the shortNumberFormatException
- If the string does not
contain a parsable short.public static short parseShort(String s, int radix) throws NumberFormatException
s
- the String containing the shortradix
- the radix to be usedNumberFormatException
- If the String does not
contain a parsable short.public short shortValue()
public String toString()
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public boolean equals(Object obj)
equals
in class Object
obj
- the object to compare withBoolean.hashCode()
,
Hashtable
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.