java.lang.Integer主要介绍
Modifier and Type | Field | Description |
---|---|---|
static final int | BYTES | int类型的字节数:4个字节 |
static final int | MAX_VALUE | 一个常量,保存一个int类型的值可以有的最大值231-1 |
static final int | MIN_VALUE | 一个常量,保存一个int类型的值可以有的最小值-231 |
static final int | SIZE | int类型的位数:32位 |
static final Class<Integer> | TYPE | 基本数据类型int的类实例 |
Constructor | Description |
---|---|
Integer(int value) | |
Integer(String s) |
Modifier and Type | Method | Description |
---|---|---|
static int | parseInt(String s) | 将字符串转换为有符号十进制整数。 |
static Integer | valueOf(int i) | 把整数i转换为Integer |
static Integer | valueOf(String s) | 把一个字符串的值转换为Integer |
Modifier and Type | Method | Description |
---|---|---|
byte | byteValue() | 把Integer转换为byte |
double | doubleValue() | 把Integer转换为double |
float | floatValue() | 把Integer转换为float |
int | intValue() | 把Integer转换为int |
long | longValue() | 把Integer转换为long |
short | shortValue() | 把Integer转换为short |
static int | compare(int x, int y) | 以数字的形式比较两个int值 |
int | compareTo(Integer anotherInteger) | 以数字的方式比较两个Integer对象 |
static int | compareUnsigned(int x, int y) | 以数字的形式比较两个int值,忽略它们的符号 |
boolean | equals(Object obj) | 比较两个对象的内容 |
int | hashCode() | 返回Integer的哈希值 |
static int | hashCode(int value) | 返回int值得哈希值,与Integer.hashCode()兼容 |
static int | max(int a, int b) | 返回两个值之中更大的那个 |
static int | min(int a, int b) | 返回两个值之中更小的那个 |
static Integer | decode(String nm) | 把一个字符串转换为Integer |
static int | parseInt(CharSequence s, int beginIndex, int endIndex, int radix) | 把一个字符序列转换为指定进制的有符号整数,从beginIndex开始解析到endIndex-1结束 |
static int | parseInt(String s) | 将字符串转换为有符号十进制整数。 |
static int | parseInt(String s, int radix) | 把一个字符串转换为指定进制的有符号整数 |
static int | parseUnsignedInt(CharSequence s, int beginIndex, int endIndex, int radix) | 同上,无符号 |
static int | parseUnsignedInt(String s) | 同上,无符号 |
static int | parseUnsignedInt(String s, int radix) | 同上,无符号 |
static int | remainderUnsigned(int dividend, int divisor) | 返回第一个参数除以第二个参数的无符号余数,两个参数也被看作无符号数 |
static String | toBinaryString(int i) | 以字符串的形式返回整数参数,该形式是二进制的无符号整数 |
static String | toHexString(int i) | 同上,十六进制 |
static String | toOctalString(int i) | 同上,八进制 |
String | toString() | 把Integer转换为字符串 |
static String | toString(int i) | 把整数参数转换为字符串 |
static String | toString(int i, int radix) | 把指定进制的整数参数转换为字符串 |
static Integer | valueOf(int i) | 把整数i转换为Integer |
static Integer | valueOf(String s) | 把一个字符串的值转换为Integer |
static Integer | valueOf(String s, int radix) | 把一个字符串的值以指定进制转换为Integer |