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?
It throws NPE because compiler does the following “magic” for you:
Obviously
i.intValue()throws NPE wheniisnull.