First of all, it is important to remember that string literals in Java are, in fact, objects (String). At the same time, if the same string literal is met several times in the program, then the same object will correspond to each literal. Therefore, strA == strB in the second case (false will be printed out).
Second of all, strings (String) in Java are immutable objects. Therefore, when another string is "concatenated" with object strA, another object, containing "text1" is actually created. Consequently, strA != strB, and true is printed out in the first case.
Actually, strA += "1" command results in strA = new StringBuilder().append(strA).append("1").toString();
And if this command is executed twice, two different objects will be created, even though they will have the same content.