从 null 中取消装箱整数
Unboxing Integer cast from null
当您执行下面的代码时,i
的值是多少?为什么?
int i = (Integer)null;
见jls5.1.8:
At run time, unboxing conversion proceeds as follows:
...
If r is null, unboxing conversion throws a NullPointerException
当您执行下面的代码时,i
的值是多少?为什么?
int i = (Integer)null;
见jls5.1.8:
At run time, unboxing conversion proceeds as follows:
...
If r is null, unboxing conversion throws a NullPointerException