Short (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Comparable<Short>, Constable
-
Field Summary
Fields
static final intThe number of bytes used to represent a
shortvalue in two's complement binary form.static final shortA constant holding the maximum value a
shortcan have, 215-1.static final shortA constant holding the minimum value a
shortcan have, -215.static final intThe number of bits used to represent a
shortvalue in two's complement binary form.The
Classinstance representing the primitive typeshort. -
Constructor Summary
Constructors
-
Method Summary
byteReturns the value of this
Shortas abyteafter a narrowing primitive conversion.static intcompare(short x, short y) Compares two
shortvalues numerically.intCompares two
Shortobjects numerically.static intcompareUnsigned(short x, short y) Compares two
shortvalues numerically treating the values as unsigned.Decodes a
Stringinto aShort.Returns an
Optionalcontaining the nominal descriptor for this instance.doubleReturns the value of this
Shortas adoubleafter a widening primitive conversion.booleanCompares this object to the specified object.
floatReturns the value of this
Shortas afloatafter a widening primitive conversion.inthashCode()Returns a hash code for this
Short; equal to the result of invokingintValue().static inthashCode(short value) Returns a hash code for a
shortvalue; compatible withShort.hashCode().intintValue()Returns the value of this
Shortas anintafter a widening primitive conversion.longReturns the value of this
Shortas alongafter a widening primitive conversion.static shortParses the string argument as a signed decimal
short.static shortParses the string argument as a signed
shortin the radix specified by the second argument.static shortreverseBytes(short i) Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified
shortvalue.shortReturns the value of this
Shortas ashort.toString()Returns a
Stringobject representing thisShort's value.toString(short s) Returns a new
Stringobject representing the specifiedshort.static inttoUnsignedInt(short x) Converts the argument to an
intby an unsigned conversion.static longtoUnsignedLong(short x) Converts the argument to a
longby an unsigned conversion.valueOf(short s) Returns a
Shortinstance representing the specifiedshortvalue.Returns a
Shortobject holding the value given by the specifiedString.Returns a
Shortobject holding the value extracted from the specifiedStringwhen parsed with the radix given by the second argument.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitCreates and returns a copy of this object.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
MIN_VALUE
-
MAX_VALUE
-
TYPE
-
SIZE
-
BYTES
-
-
Constructor Details
-
Short
-
Short
-
-
Method Details
-
toString
-
parseShort
-
parseShort
-
valueOf
-
valueOf
-
describeConstable
-
valueOf
-
decode
-
byteValue
-
shortValue
-
intValue
-
longValue
-
floatValue
-
doubleValue
-
toString
-
hashCode
-
hashCode
-
equals
-
compareTo
-
compare
-
compareUnsigned
-
reverseBytes
-
toUnsignedInt
-
toUnsignedLong
-