值为 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)![]() |