Can someone please explain the internal working of below code snippet
ArrayList<Integer> a = new ArrayList<>(Arrays.asList(902,902));
System.out.println(a.get(0)+" "+a.get(1)+" "+(a.get(0) == a.get(1)));
ArrayList<Integer> b = new ArrayList<>(Arrays.asList(11,11));
System.out.println(b.get(0)+" "+b.get(1)+" "+(b.get(0) == b.get(1)));
Output :
902 902 false
11 11 true
Why the first one is false and the second one is true while the numbers are equal.