Java--Integer 向右看齐 2022-11-25 10:16 158阅读 0赞 原文网址:[Java--Integer\_IT利刃出鞘的博客-CSDN博客][Java--Integer_IT_-CSDN] # 简介 # <table style="width:688px;"> 字段摘要 <tbody> <tr> <td style="vertical-align:top;width:172px;">类型</td> <td style="vertical-align:top;width:106px;">字段名</td> <td style="vertical-align:top;width:408px;">说明</td> </tr> <tr> <td style="vertical-align:top;width:172px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="vertical-align:top;width:106px;"> <p style="margin-left:0pt;"><strong><a title="MAX_VALUE" rel="nofollow">MAX_VALUE</a></strong></p> </td> <td style="vertical-align:top;width:408px;"> <p style="margin-left:0pt;"><span style="color:#000000;">值为 2</span><span style="color:#000000;">31</span><span style="color:#000000;">-1 的常量,它表示 </span><span style="color:#000000;">int</span><span style="color:#000000;"> 类型能够表示的最大值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:172px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="vertical-align:top;width:106px;"> <p style="margin-left:0pt;"><strong><a title="MIN_VALUE" rel="nofollow">MIN_VALUE</a></strong></p> </td> <td style="vertical-align:top;width:408px;"> <p style="margin-left:0pt;"><span style="color:#000000;">值为 -2</span><span style="color:#000000;">31</span><span style="color:#000000;"> 的常量,它表示 </span><span style="color:#000000;">int</span><span style="color:#000000;"> 类型能够表示的最小值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:172px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="vertical-align:top;width:106px;"> <p style="margin-left:0pt;"><strong><a title="SIZE" rel="nofollow">SIZE</a></strong></p> </td> <td style="vertical-align:top;width:408px;"> <p style="margin-left:0pt;"><span style="color:#000000;">用来以二进制补码形式表示 </span><span style="color:#000000;">int</span><span style="color:#000000;"> 值的比特位数。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:172px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Class.html" title="Class" rel="nofollow">Class</a><<a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a>></p> </td> <td style="vertical-align:top;width:106px;"> <p style="margin-left:0pt;"><strong><a title="TYPE" rel="nofollow">TYPE</a></strong></p> </td> <td style="vertical-align:top;width:408px;"> <p style="margin-left:0pt;"><span style="color:#000000;">基本类型 </span><span style="color:#000000;">int</span><span style="color:#000000;"> 的 </span><span style="color:#000000;">Class</span><span style="color:#000000;"> 实例。</span></p> </td> </tr> </tbody> </table> <table style="width:663px;"> 构造方法 <tbody> <tr> <td style="vertical-align:top;width:183px;"> <p style="margin-left:0pt;">方法</p> </td> <td style="vertical-align:top;width:477px;"> <p style="margin-left:0pt;">说明</p> </td> </tr> <tr> <td style="vertical-align:top;width:183px;"> <p style="margin-left:0pt;"><strong><a title="Integer" rel="nofollow">Integer</a></strong>(int value)</p> </td> <td style="vertical-align:top;width:477px;"> <p style="margin-left:0pt;"><span style="color:#000000;">构造一个新分配的 </span><span style="color:#000000;">Integer</span><span style="color:#000000;"> 对象,它表示指定的 </span><span style="color:#000000;">int</span><span style="color:#000000;"> 值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:183px;"> <p style="margin-left:0pt;"><strong><a title="Integer" rel="nofollow">Integer</a></strong>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> s)</p> </td> <td style="vertical-align:top;width:477px;"> <p style="margin-left:0pt;"><span style="color:#000000;">构造一个新分配的 </span><span style="color:#000000;">Integer</span><span style="color:#000000;"> 对象,它表示 </span><span style="color:#000000;">String</span><span style="color:#000000;"> 参数所指示的 </span><span style="color:#000000;">int</span><span style="color:#000000;"> 值。</span></p> </td> </tr> </tbody> </table> <table> 其他方法 <tbody> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><strong><strong>返回类型</strong></strong></p> </td> <td style="vertical-align:top;width:238px;"> <p style="margin-left:0pt;"><strong><strong>方法</strong></strong></p> </td> <td style="vertical-align:top;width:567px;"> <p style="margin-left:0pt;"><strong><strong>说明</strong></strong></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="bitCount" rel="nofollow">bitCount</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回指定</span><span style="color:#000000;">int</span><span style="color:#000000;">值的二进制补码表示形式的 1 位的数量。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">byte</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="byteValue" rel="nofollow">byteValue</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以</span><span style="color:#000000;">byte</span><span style="color:#000000;">类型返回该</span><span style="color:#000000;">Integer</span><span style="color:#000000;">的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="compareTo" rel="nofollow">compareTo</a>(<a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a> <span style="color:#000000;">anotherInteger)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">在数字上比较两个</span><span style="color:#000000;">Integer</span><span style="color:#000000;">对象。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="decode" rel="nofollow">decode</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">nm)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">将</span><span style="color:#000000;">String</span><span style="color:#000000;">解码为</span><span style="color:#000000;">Integer</span><span style="color:#000000;">。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">double</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="doubleValue" rel="nofollow">doubleValue</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以</span><span style="color:#000000;">double</span><span style="color:#000000;">类型返回该</span><span style="color:#000000;">Integer</span><span style="color:#000000;">的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">boolean</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="equals" rel="nofollow">equals</a>(<a href="https://aisia.moe/java6api-cn/java/lang/Object.html" title="Object" rel="nofollow">Object</a> <span style="color:#000000;">obj)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">比较此对象与指定对象。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">float</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="floatValue" rel="nofollow">floatValue</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以</span><span style="color:#000000;">float</span><span style="color:#000000;">类型返回该</span><span style="color:#000000;">Integer</span><span style="color:#000000;">的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="getInteger" rel="nofollow">getInteger</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">nm)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">确定具有指定名称的系统属性的整数值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="getInteger" rel="nofollow">getInteger</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">nm, int val)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">确定具有指定名称的系统属性的整数值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="getInteger" rel="nofollow">getInteger</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">nm,</span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a> <span style="color:#000000;">val)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回具有指定名称的系统属性的整数值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="hashCode" rel="nofollow">hashCode</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回此</span><span style="color:#000000;">Integer</span><span style="color:#000000;">的哈希码。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="highestOneBit" rel="nofollow">highestOneBit</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回具有至多单个 1 位的</span><span style="color:#000000;">int</span><span style="color:#000000;">值,在指定的</span><span style="color:#000000;">int</span><span style="color:#000000;">值中最高位(最左边)的 1 位的位置。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="intValue" rel="nofollow">intValue</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以</span><span style="color:#000000;">int</span><span style="color:#000000;">类型返回该</span><span style="color:#000000;">Integer</span><span style="color:#000000;">的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">long</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="longValue" rel="nofollow">longValue</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以</span><span style="color:#000000;">long</span><span style="color:#000000;">类型返回该</span><span style="color:#000000;">Integer</span><span style="color:#000000;">的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="lowestOneBit" rel="nofollow">lowestOneBit</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回具有至多单个 1 位的</span><span style="color:#000000;">int</span><span style="color:#000000;">值,在指定的</span><span style="color:#000000;">int</span><span style="color:#000000;">值中最低位(最右边)的 1 位的位置。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="numberOfLeadingZeros" rel="nofollow">numberOfLeadingZeros</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">在指定</span><span style="color:#000000;">int</span><span style="color:#000000;">值的二进制补码表示形式中最高位(最左边)的 1 位之前,返回零位的数量。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="numberOfTrailingZeros" rel="nofollow">numberOfTrailingZeros</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回指定的</span><span style="color:#000000;">int</span><span style="color:#000000;">值的二进制补码表示形式中最低(“最右边”)的为 1 的位后面的零位个数。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><strong><a title="parseInt" rel="nofollow">parseInt</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">s)</span></strong></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">将字符串参数作为有符号的十进制整数进行解析。</span></p> <p style="margin-left:0pt;">例如:Integer.parseInt("10"); 结果为10</p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><strong><a title="parseInt" rel="nofollow">parseInt</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">s, int radix)</span></strong></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">使用第二个参数指定的基数,将字符串参数解析为有符号的整数。</span></p> <p style="margin-left:0pt;">例如:Integer.parseInt("a", 16); 结果为10</p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="reverse" rel="nofollow">reverse</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回通过反转指定</span><span style="color:#000000;">int</span><span style="color:#000000;">值的二进制补码表示形式中位的顺序而获得的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="reverseBytes" rel="nofollow">reverseBytes</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回通过反转指定</span><span style="color:#000000;">int</span><span style="color:#000000;">值的二进制补码表示形式中字节的顺序而获得的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="rotateLeft" rel="nofollow">rotateLeft</a>(int i, int distance)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回根据指定的位数循环左移指定的</span><span style="color:#000000;">int</span><span style="color:#000000;">值的二进制补码表示形式而得到的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="rotateRight" rel="nofollow">rotateRight</a>(int i, int distance)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回根据指定的位数循环右移指定的</span><span style="color:#000000;">int</span><span style="color:#000000;">值的二进制补码表示形式而得到的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">short</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="shortValue" rel="nofollow">shortValue</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以</span><span style="color:#000000;">short</span><span style="color:#000000;">类型返回该</span><span style="color:#000000;">Integer</span><span style="color:#000000;">的值。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static int</span></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="signum" rel="nofollow">signum</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回指定</span><span style="color:#000000;">int</span><span style="color:#000000;">值的符号函数。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="toBinaryString" rel="nofollow">toBinaryString</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以二进制(基数 2)无符号整数形式返回一个整数参数的字符串表示形式。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="toHexString" rel="nofollow">toHexString</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以十六进制(基数 16)无符号整数形式返回一个整数参数的字符串表示形式。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="toOctalString" rel="nofollow">toOctalString</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">以八进制(基数 8)无符号整数形式返回一个整数参数的字符串表示形式。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="toString" rel="nofollow">toString</a>()</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回一个表示该</span><span style="color:#000000;">Integer</span><span style="color:#000000;">值的</span><span style="color:#000000;">String</span><span style="color:#000000;">对象。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="toString" rel="nofollow">toString</a>(int i)</p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回一个表示指定整数的</span><span style="color:#000000;">String</span><span style="color:#000000;">对象。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><strong><a title="toString" rel="nofollow">toString</a>(int i, int radix)</strong></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回一个表示指定整数的</span><span style="color:#000000;">String</span><span style="color:#000000;">对象。第二个参数为进制</span></p> <p style="margin-left:0pt;">示例:Integer.toString(10, 16) //结果:a</p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><strong><a title="valueOf" rel="nofollow">valueOf</a>(int i)</strong></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回一个表示指定的</span><span style="color:#000000;">int</span><span style="color:#000000;">值的</span><span style="color:#000000;">Integer</span><span style="color:#000000;">实例。</span></p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="valueOf" rel="nofollow">valueOf</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">s)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回保存指定的</span><span style="color:#000000;">String</span><span style="color:#000000;">的值的</span><span style="color:#000000;">Integer</span><span style="color:#000000;">对象。</span></p> <p style="margin-left:0pt;">示例:Integer.valueOf("10") + 2; //结果:12</p> </td> </tr> <tr> <td style="vertical-align:top;width:101px;"> <p style="margin-left:0pt;"><span style="color:#000000;">static </span><a href="https://aisia.moe/java6api-cn/java/lang/Integer.html" title="Integer" rel="nofollow">Integer</a></p> </td> <td style="width:238px;"> <p style="margin-left:0pt;"><a title="valueOf" rel="nofollow">valueOf</a>(<a href="https://aisia.moe/java6api-cn/java/lang/String.html" title="String" rel="nofollow">String</a> <span style="color:#000000;">s, int radix)</span></p> </td> <td style="width:567px;"> <p style="margin-left:0pt;"><span style="color:#000000;">返回一个</span><span style="color:#000000;">Integer</span><span style="color:#000000;">对象,第二个参数为进制。</span></p> <p style="margin-left:0pt;"><span style="color:#000000;">示例:Integer.valueOf("b", 16) //结果:11</span></p> </td> </tr> </tbody> </table> # 其他网址 # [在线文档-jdk-zh][-jdk-zh] [Java--Integer_IT_-CSDN]: https://knife.blog.csdn.net/article/details/107872755 [-jdk-zh]: https://tool.oschina.net/apidocs/apidoc?api=jdk-zh
还没有评论,来说两句吧...