String比较全解析

  == equals 解释
a b  true   true  
a c false  true   
a e  true  true   
a g true  true   
f g false  true   

String a = "hello2";
String b = "hello2";
String c = new String("hello2");
final String d = "hello";
final String e = "hello2";

String f = "hello";
String g = d + 2;
String h = f + 2;

  

posted @ 2018-08-20 15:37  R4mble  阅读(81)  评论(0编辑  收藏  举报