The line String str12 = "He" + "llo"; causes the compiler to create a String constant "Hello". Since all the pieces being concatted together are compile-time constants, the compiler can treat treat them as a single String. So, like all string literals, it goes into the constant pool.
Then we intern str11, which also has contents "Hello". The result we get back from intern() is a reference to a String in the constant pool. Since "Hello" was already there from the above steps, it's the same object, and == is true.
String s1 = "lo";
String str11 = "Hel"+ s1;
String str12 = "He" + "llo";
System.out.println(" str11 == str12 is " + (str11 == str12));
Here we did not intern str11, so we're comparing a reference to a String in the pool with a reference to a String out of the pool, so two different objects, so == is false.