What is the value of i when you execute the code below and why?
i
int i = (Integer)null;
See jls5.1.8:
At run time, unboxing conversion proceeds as follows: ... If r is null, unboxing conversion throws a NullPointerException
At run time, unboxing conversion proceeds as follows:
...
If r is null, unboxing conversion throws a NullPointerException