基础_String

    String str1="hello";
     String str2="hello";
     String str3="hello";
     String str4=new String("hello");
     String str5=str4;
     System.out.println(str1==str2); //true
     System.out.println(str1==str3);//false
     System.out.println(str1==str4);//false
     System.out.println(str4==str5);//true

原文地址:https://www.cnblogs.com/blackheartinsunshine/p/5234585.html