Short constructor
Short(
- int value
Creates a Short with the specified value.
value
the short value to wrap (must be between -32768 and 32767)
Throws InvalidArgumentException if value is outside short range.
A wrapper class for int representing a 16-bit signed integer.
This class wraps a short integer value and provides Java-like functionality similar to Java's Short class.
Example usage:
Short s1 = Short(32767);
Short s2 = Short.parseShort("1000");
Short s3 = Short.valueOf(-32768);
print(s1.toString()); // "32767"
print(s1.toUnsigned()); // 32767
Implementation
Short(int value) : _value = _validateShortRange(value);