java.lang
类 Integer
java.lang.Object
java.lang.Number
java.lang.Integer
全部已实现的接口:
Serializable, Comparable<Integer>
public final class Integer
extends Number
implements Comparable<Integer>
Integer 类在对象中包装了一个基本类型 int 的值。Integer 类型的对象包括一个 int 类型的字段。
此外,该类提供了多个方法,能在 int 类型和 String 类型之间互相转换,还提供了处理 int 类型时很实用的其它一些常量和方法。
实现注意事项:“bit twiddling”方法(如 highestOneBit 和 numberOfTrailingZeros)的实现基于 Henry S. Warren, Jr.撰写的《Hacker's Delight》(Addison Wesley, 2002)中的一些有关材料。
从下面版本号開始:
JDK1.0
另请參见:
序列化表格
|
| |
| static int | MAX_VALUE |
| static int | MIN_VALUE |
| static int | SIZE |
| static Class<Integer> | TYPE |
| 构造方法摘要
| |
| Integer(int value) |
|
| Integer(String s) |
|
| 方法摘要
| |
| static int | bitCount(int i) |
| byte | byteValue() |
| int | compareTo(Integer anotherInteger) |
| static Integer | decode(String nm) |
| double | doubleValue() |
| boolean | equals(Object obj) |
| float | floatValue() |
| static Integer | getInteger(String nm) |
| static Integer | getInteger(String nm, int val) |
| static Integer | getInteger(String nm, Integer val) |
| int | hashCode() |
| static int | highestOneBit(int i) |
| int | intValue() |
| long | longValue() |
| static int | lowestOneBit(int i) |
| static int | numberOfLeadingZeros(int i) |
| static int | numberOfTrailingZeros(int i) |
| static int | parseInt(String s) |
| static int | parseInt(String s, int radix) |
| static int | reverse(int i) |
| static int | reverseBytes(int i) |
| static int | rotateLeft(int i, int distance) |
| static int | rotateRight(int i, int distance) |
| short | shortValue() |
| static int | signum(int i) |
| static String | toBinaryString(int i) |
| static String | toHexString(int i) |
| static String | toOctalString(int i) |
| String | toString() |
| static String | toString(int i) |
| static String | toString(int i, int radix) |
| static Integer | valueOf(int i) |
| static Integer | valueOf(String s) |
| static Integer | valueOf(String s, int radix) |