值爲 215-1 的常量,它表示 short 類型可以表示的最大值 public static final short MAX_VALUE = 32767; |
值爲 -215 的常量,它表示 short 類型可以表示的最小值 public static final short MIN_VALUE = -32768; |
用來以二進制補碼形式表示 short 值的比特位數 public static final int SIZE = 16; |
二進制補碼形式表示 short 值的字節數 public static final int BYTES = SIZE / Byte.SIZE; |
表示基本類型 short 的 Class 實例 public static final Class<Short> TYPE = (Class<Short>) Class.getPrimitiveClass("short"); |
static int compare(short x, short y)
靜態方法
x<y 小於0
x=y 等於0
x>y 大於0
![]() |
int compareTo(Short anotherShort) 實例方法 調用靜態方法比較兩個對象的值 ![]() |
static Short valueOf(short s)![]() |
static Short valueOf(String s, int radix)![]() |
static Short valueOf(String s)![]() |
相似 Integer和Long Byte Short也有提供XXXValue系列方法,原理也跟他們相似 所有都是強轉 |
byteValue()
shortValue()
intValue()
longValue()
floatValue()
doubleValue()
|
static String toString(short s)![]() |
String toString()![]() |
static int toUnsignedInt(short x) ![]() |
static long toUnsignedLong(short x)![]() |