Multiple choice technology programming languages

What will be the ouput of the following code snippet? String myString1 = "Java"; String myString2 = new String("Java"); System.out.println(myString1 == myString2 ^ myString1.equals(myString2));

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The expression compares a string literal and a new string object using reference equality (==) which returns false, and content equality (equals) which returns true. The XOR operator (^) evaluates false ^ true as true because the operands differ.