字符串對象和字符串文字之間的區別[重複] - 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章