I'm new-ish to learning Java, but I'm just beginning to understand value types vs reference types. As I understand it, a String is a reference type. Unlike other reference types, however, I can print a String without it printing some weird combination of letters and numbers. Why is that? Furthermore, say I have the code
String s1 = "x";
String s2 = s1;
s1 = "xyz";
System.out.println(s2);
it will print "x", and not "xyz", even though I changed the object s2 is referring to. This doesn't happen when I change, say, an Array. Why are Strings special?