Both will return true.
1) 2 new string objects are created but use .equals
which means their actual value is compared. Which is equal.
2) 1 new string object is created because they are both constant at compile time. This will result in them pointing to the same object.
This sentence might be your issue:
== was used here making it look at the two values and it recognises that they both have the exact same characters.
==
checks for reference equality whereas you're describing value equality.