title: Why shouldn't I use the equality operator for objects
body: <p>I have this book about Java and it is telling me if I use relational operators for objects such as strings it will turn out as false. Even if two strings have the same literal value. I tested this, yet true was printed. Could someone explain why this is?</p>
  
  <pre><code>String y = "Not null";
  String x = "Not null";
  
              if(x == y)
                  System.out.println("True");
  </code></pre>