字符串对象和字符串文字之间的区别[重复] - Difference between string object and string literal [duplicate]

问题:

This question already has answers here : 这个问题在这里已经有了答案
Closed 7 years ago . 7年前关闭。

What is the difference between之间有什么区别

String str = new String("abc");

and

String str = "abc";

解决方案:

参考一: https://en.stackoom.com/question/DpvP
参考二: https://stackoom.com/question/DpvP
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章