CSC300 / CSC402: String Constructor [7/24] |
String x = new String ("Hello"); String y = new String ("Hello"); x=Hello, y=Hello x==y : false Objects.equals(x,y) : true x.equals(y) : true |
One of the guarantees of Java is that using new
will always construct a new object.