Posted on Leave a comment

Java feature/bug

1.

[code language=”java”]
public static void main(String[] args) {
System.out.println(Byte.valueOf((byte) 48) == Byte.valueOf((byte) 48));
System.out.println(Byte.valueOf((byte) 248) == Byte.valueOf((byte) 248));
System.out.println(Integer.valueOf(48) == Integer.valueOf(48));
System.out.println(Integer.valueOf(248) == Integer.valueOf(248));
}
[/code]

Answer

[code language=”java”]
true
true
true
false
[/code]

Continue reading Java feature/bug