将在String s =" Sachin" +"中创建多少个String对象。泰杜尔卡英寸; [英] How many String objects will be created in String s="Sachin"+" Tendulkar";

查看:116
本文介绍了将在String s =" Sachin" +"中创建多少个String对象。泰杜尔卡英寸;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在声明String s =Sachin+Tendulkar中创建了多少个String对象; ?这是我的面试问题

how many String objects are created in the declaration String s="Sachin"+" Tendulkar"; ? This is my interview question

推荐答案

how many String objects are created in the above declaration? 
This is my interview question




  • Sachin - >字符串文字

    • "Sachin" -> String literal

      Tendulkar - >字符串文字

      "Tendulkar" -> String literal

      只有一个字符串s 是根据两个文字的连接而创建的

      only one String s is created from concatenation of the two literals

      这篇关于将在String s =" Sachin" +"中创建多少个String对象。泰杜尔卡英寸;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆