class Main {
public static void main(String[] args) {
String a = new String("hi");
String b = new String("hi");
// == asks: the same object?
System.out.println(a == b);
// equals asks: the same contents?
System.out.println(a.equals(b));
}
}identity versus value equality