public final class Short extends Number implements Comparable<Short>
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 |
---|---|
static int |
compare(short s1,
short s2) |
int |
compareTo(Short another)
Compares this object to the specified object to determine their relative
order.
|
double |
doubleValue() |
boolean |
equals(Object obj)
Compares this object to the specified object.
|
float |
floatValue() |
int |
hashCode()
Returns a hashcode for this Short.
|
int |
intValue() |
long |
longValue() |
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.
|
static Short |
valueOf(short i)
Returns the object instance of i
|
public static final short MAX_VALUE
public static final short MIN_VALUE
public Short(short value)
public boolean equals(Object obj)
public int hashCode()
public static short parseShort(String s) throws NumberFormatException
NumberFormatException
public static short parseShort(String s, int radix) throws NumberFormatException
NumberFormatException
public short shortValue()
shortValue
in class Number
public String toString()
public static Short valueOf(short i)
i
- the primitivepublic float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public int compareTo(Short another)
Comparable
compareTo
in interface Comparable<Short>
another
- the object to compare to this instance.another
;
a positive integer if this instance is greater than
another
; 0 if this instance has the same order as
another
.public static int compare(short s1, short s2)