CSC300 / CSC402: String Operators [8/24] |
String x = "Hel" + "lo"; String y = "Hel" + "lo"; x=Hello, y=Hello x==y : true Objects.equals(x,y) : true x.equals(y) : true |
Java is being efficient by looking for a canonical representation of the string.