重複の可能性:
Weird Java Boxing
public class example {
public static void main(String[] args) {
Integer a=127,b=127;
if(a==b)
System.out.println("Equal");
else
System.out.println("Not Equal");
Integer c=128,d=128;
if(c==d)
System.out.println("Equal");
else
System.out.println("Not Equal");
}
}
出力:
Equal
Not Equal