Should a merge of hashes of two String objects be the same as a hash of their concatenation? I was using XOR ^ operator (as advised here) and got a different result.
What I am doing wrong?
String a = "A";
String b = "B";
String ab = a+b;
int i = a.hashCode() ^ b.hashCode();
System.out.println(
a.hashCode()+"\n"+
b.hashCode()+"\n"+
ab.hashCode()+"\n"
i);