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?
String y = "Not null";
String x = "Not null";
if(x == y)
System.out.println("True");