String a = "abc";
String b = a;
String c = a + "";
String d = new String("abc");
System.out.println(a == b); // true
System.out.println(b == c); // false
System.out.println(a == c); // false
System.out.println(a.equals(b)); // true
System.out.println(b.equals(c)); // true
System.out.println(a.equals(c)); // true
System.out.println(a == d); // false
System.out.println("abc" == d); // false
System.out.println("abc" == a); // true
Integer h = 100;
Integer i = 100;
Integer j = 200;
Integer k = 200;
int l = 200;
int m = 200;
System.out.println(h == i); // true
System.out.println(j == k); // false
System.out.println(j == m); // true
System.out.println(l == m); // true
Boolean o = true;
Boolean p = new Boolean(true);
Boolean q = true;
System.out.println(o == p); // false
System.out.println(o == q); // true