Java中String="hello"和new String("hello')兩種創建字符串的區別

原帖地址:https://blog.csdn.net/zqzq310918/article/details/54313262 String str="hello"; String str1="hello"; String str2=new String("hello"); String str3=new String("hello");  1)對於==,如果作用於基本數據類型的變量,則直接比較其存
相關文章
相關標籤/搜索