1
JavaBeginner#oop
== compares references (memory addresses) for objects and values for primitives. equals() is a method that compares the actual content. By default Object.equals() behaves like ==, but classes like String and Integer override it to compare values.
String a = new String("hi");
String b = new String("hi");
a == b; // false (different objects)
a.equals(b); // true (same content)