fork download
  1. class Ideone
  2. {
  3. public static void main (String[] args)
  4. {
  5. Byte a = Byte.valueOf((byte) 2);
  6. Byte b = 2;
  7. Byte c = new Byte((byte) 2);
  8.  
  9. System.out.printf("a: %d, %d\n", a.hashCode(), System.identityHashCode(a));
  10. System.out.printf("b: %d, %d\n", b.hashCode(), System.identityHashCode(b));
  11. System.out.printf("c: %d, %d\n", c.hashCode(), System.identityHashCode(c));
  12. }
  13. }
Success #stdin #stdout 0.08s 34240KB
stdin
Standard input is empty
stdout
a: 2, 804564176
b: 2, 804564176
c: 2, 1418481495