I recently learned that in Java: == compares the object references, not the content, which is why:
String str1 = "hell";
String str2 = "o";
String str3 = str1 + str2;
String str4 = "hello";
str3 == str4; // False
So far so good. However when I do the following:
String str5 = "hello";
str5 == str4; // True
Does this mean that str5 and str4 reference the same memory object? How does this work?