① String s1 = "hello"
String s2 = "hello"
s1 == s2
s1 equals s2
② String s1 = "hello"
String s2 = new String("hello")
s1 != s2
s1 equals s2
③ String s1 = "hello"
String s2 = new String("hello")
s2 = s2.intern()
s1 == s2
s1 equals s2
④ int a1 = 1
int a2 = 1
Integer b1 = new Integer(1)
Integer b2 = new Integer(1)
a1 == a2
a1 == b1 false (jdk1.5以上 true)
b1 == b2 false
b1 equals b2