Given two snippets of code with the Integer class.
Integer i1 = 100;
Integer i2 = 100;
System.out.println(i1 == i2); // true
Integer i1 = 200;
Integer i2 = 200;
System.out.println(i1 == i2); // false
Why are the results different?
Given two snippets of code with the Integer class.
Integer i1 = 100;
Integer i2 = 100;
System.out.println(i1 == i2); // true
Integer i1 = 200;
Integer i2 = 200;
System.out.println(i1 == i2); // false
Why are the results different?
Create a free account to access the full topic