Engineering Full Stack Apps with Java and JavaScript
Given the following declarations, identify which statements will return true:
Integer i1 = 1;
Integer i2 = new Integer(1);
int i3 = 1;
Byte b1 = 1;
Long g1 = 1L;
Note: Although primitive wrapper classes are not explicitly mentioned in the exam objectives, we have seen some candidates get questions on this aspect of wrapper classes.
Select 2 options
A. i1 == i2
B. i1 == i3
C. i1 == b1
D. i1.equals(i2)
E. i1.equals(g1)
F. i1.equals(b1)