为了账号安全,请及时绑定邮箱和手机立即绑定

什么情况需要用到=new String(),为啥不直接=“字符串”,两者有啥区别

package first1;

public class _first1 {

public static void main(String[] args) {

String str="abc ABC";//教课书上是String str=new String("abc ABC")

String str2="def DEF";//教课书上是String str=new String("def DEF")

String str3=str.toLowerCase();

String str4=str2.toUpperCase();

System.out.println(str3);

System.out.println(str4);

}

}


正在回答

举报

0/150
提交
取消

什么情况需要用到=new String(),为啥不直接=“字符串”,两者有啥区别

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号