日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

java学习(86):Interage方法compareto,parseint,intvalue

發(fā)布時(shí)間:2023/12/10 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java学习(86):Interage方法compareto,parseint,intvalue 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
public class test22 {public static void main(String[] args){int num=5;Integer obj1=new Integer(num);System.out.println("obj1的值為"+obj1);Integer obj2=100;System.out.println("obj2的值為"+obj2);Integer obj3=new Integer("-789");System.out.println("obj3的值為"+obj3);System.out.println(Integer.BYTES);System.out.println(Integer.MAX_VALUE);System.out.println(Integer.MIN_VALUE);System.out.println(Integer.SIZE);//比較大小System.out.println(obj2.compareTo(100));System.out.println(obj2.compareTo(102));System.out.println(obj2.compareTo(10));//返回值類型int num1=obj2.intValue();System.out.println(num1);//將一個(gè)字符串轉(zhuǎn)換為int數(shù)據(jù)返回int str1=Integer.parseInt("125");System.out.println(str1+12); } }

運(yùn)行結(jié)果

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的java学习(86):Interage方法compareto,parseint,intvalue的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。