public static void main(String[] args) {
ArrayList<Integer> myList = new ArrayList<Integer>();
myList.add(2000);
myList.add(2000);
myList.add(2);
myList.add(2);
if(myList.get(1)==myList.get(0))System.out.println("2000 equal check");
if(myList.get(1)!=myList.get(0))System.out.println("2000 not equal check");
if(myList.get(2)==myList.get(3))System.out.println("2 equal check");
if(myList.get(2)!=myList.get(3))System.out.println("2 not equal check");
}
My code is shown above. And the results are shown below.
2000 not equal check
2 equal check
The results show me very wired things..
I am really confused... I appreciate if somebody can help me with this.