Java中Integer类的方法
java.lang
類(lèi) Integer
java.lang.Object
? java.lang.Number
???? ?java.lang.Integer
全部已實(shí)現(xiàn)的接口:
Serializable, Comparable<Integer>
public final class Integer
extends Number
implements Comparable<Integer>
Integer 類(lèi)在對(duì)象中包裝了一個(gè)基本類(lèi)型 int 的值。Integer 類(lèi)型的對(duì)象包括一個(gè) int 類(lèi)型的字段。
此外,該類(lèi)提供了多個(gè)方法,能在 int 類(lèi)型和 String 類(lèi)型之間互相轉(zhuǎn)換,還提供了處理 int 類(lèi)型時(shí)很實(shí)用的其它一些常量和方法。
實(shí)現(xiàn)注意事項(xiàng):“bit twiddling”方法(如 highestOneBit 和 numberOfTrailingZeros)的實(shí)現(xiàn)基于 Henry S. Warren, Jr.撰寫(xiě)的《Hacker's Delight》(Addison Wesley, 2002)中的一些有關(guān)材料。
從下面版本號(hào)開(kāi)始:
JDK1.0
另請(qǐng)參見(jiàn):
序列化表格
| 字段摘要
| |
| static?int | MAX_VALUE |
| static?int | MIN_VALUE |
| static?int | SIZE |
| static?Class<Integer> | TYPE |
?
| 構(gòu)造方法摘要
| |
| 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) |
?
轉(zhuǎn)載于:https://www.cnblogs.com/zfyouxi/p/4329500.html
總結(jié)
以上是生活随笔為你收集整理的Java中Integer类的方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: contenttype添加field
- 下一篇: java听课笔记(六)