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)对于==,如果作用于基本数据类型的变量,则直接比较其存
相关文章
相关标签/搜索