------Java培训、Android培训、iOS培训、.Net培训、期待与您交流! -------
Java Integer类
1、常量。
int MAX_VALUE:返回最大的整型数;
2、构造方法。
Integer(int value) :通过一个int的类型构造对象;
Integer(String s) :通过一个String的类型构造对象;
3、静态方法和成员方法
static int parseInt(String s) 将一个String解析为一个int,如参数为字符串”123“,调用该方法可得到整数123
4. static Integer decode(String s) :将字符串转换为整数。
5. double doubleValue() :取得该整数的双精度表示。
6. boolean equals(Object obj) :比较两个对象。
7. float floatValue() :取得该整数的浮点数表示。
8. static Integer getInteger(String s) :根据指定名确定系统特征值。
24. static Integer valueOf(String s, int radix) :将字符串以基数radix的要求转换成整数类型
int MAX_VALUE:返回最大的整型数;
int MIN_VALUE:返回最小的整型数;
Class TYPE :返回当前类型。
2、构造方法。
Integer(int value) :通过一个int的类型构造对象;
Integer(String s) :通过一个String的类型构造对象;
3、静态方法和成员方法
static int parseInt(String s) 将一个String解析为一个int,如参数为字符串”123“,调用该方法可得到整数123
4. static Integer decode(String s) :将字符串转换为整数。
5. double doubleValue() :取得该整数的双精度表示。
6. boolean equals(Object obj) :比较两个对象。
7. float floatValue() :取得该整数的浮点数表示。
8. static Integer getInteger(String s) :根据指定名确定系统特征值。
9. static Integer getInteger(String s, int i) :上面的重载。
10. static Integer getInteger(String s, Integer i) :上面的重载。
11。 int hashCode() :返回该整数类型的哈希表码。
12. int intValue() : 返回该整型数所表示的整数。
13. long longValue() :返回该整型数所表示的长整数。
14. static int parseInt(String s) :将字符串转换成整数。s必须是时进制数组成,否则抛出NumberFormatException异常。
15. static int parseInt(String s, int radix) :以radix为基数radix返回s的十进制数。所谓的基数,就是“几进制”。
16. short shortValue() :返回该整型数所表示的短整数。
17. static String toBinaryString(int i) :将整数转为二进制数的字符串。
18. static String toHexString(int i) :将整数转为十六进制数的字符串。
19. static String toOctalString(int i) :将整数转为八进制数的字符串。
20. String toString() :将该整数类型转换为字符串。
21. static String toString(int i) :将该整数类型转换为字符串。不同的是,此为类方法。
22. static String toString(int i, int radix) :将整数i以基数radix的形式转换成字符串。
23. static Integer valueOf(String s) :将字符串转换成整数类型。