Integer i = null;
if (i == 3)
Why the second line above throws a NullPointerException
, IMHO, this has only one meaning which is Wrapper Object i
is to be unboxed which yields the Exception such as:
ArrayList<Integer> list = new ArrayList<Integer>();
list.add(null);
int x = list.get(0);
EDIT: Can you supply me with some format doc?