zoukankan      html  css  js  c++  java
  • String<-->int

    String s = "123);
    
    int a = Integer.parseInt(s);
    
    String b = String.valueOf(a);


    Integer i = 100;  自动封装

    i  + = 100;  自动拆装-->自动封装


    针对-128到127之间的数据,做了一个缓冲池,如果是该范围内的,每次并不创建新的对象,具体可以看源码

    Integer i1 = 127;

    Integer i2 = 127;

    Integer i3 = 128;

    Integer i4 = 128;

    System.out.println(i1==i2);  true
    System.out.println(i3==i4);  false




  • 相关阅读:
    模板
    洛谷
    Codeforces
    Codeforces
    Codeforces
    Codeforces
    洛谷
    洛谷
    洛谷
    NOIP 普及组 2016 海港
  • 原文地址:https://www.cnblogs.com/gxlaqj/p/10686298.html
Copyright © 2011-2022 走看看