V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
theday2009
V2EX  ›  程序员

String s = new String(“abc”)到底 new 了几个对象

  •  
  •   theday2009 · Jul 25, 2018 · 3383 views
    This topic created in 2833 days ago, the information mentioned may be changed or developed.
    我知道 abc 存储在常量池的静态区,我也知道如果 abc 在常量池已经存在,就直接用地址使用,但 s 这个对象里面,存的是常量池的地址吗,一共 new 了几个对象,谁能说清楚。。。
    3 replies    2018-07-26 00:04:20 +08:00
    cexy
        1
    cexy  
       Jul 25, 2018   ❤️ 2
    252748371
        2
    252748371  
       Jul 25, 2018 via Android
    1 个
    429463267
        3
    429463267  
       Jul 26, 2018
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4363 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 00:58 · PVG 08:58 · LAX 17:58 · JFK 20:58
    ♥ Do have faith in what you're doing.