I know that we shouldn't compare Strings with == and its better to use equals.
For so far I learned this should all be false.
So why does the first method return true?
private String ab = "AB";
private String ab2 = "A" + "B";
private String a = "A";
private String b = "B";
private String ab3 = a + b;
public void test () {
System.out.println("ab == ab2" + ab==ab2);
System.out.println("ab == ab3" + ab==ab3);
System.out.println("ab == a+b" + ab==(a+b));
}