Why does autoboxing in Java allow me to have 3 possible values for a boolean?

后端 未结 9 687
你的背包
你的背包 2020-12-06 07:43

Reference: http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html

\"If your program tries to autounbox null, it will throw a NullPointerEx

9条回答
  •  余生分开走
    2020-12-06 08:06

    It is the problem with autoboxing, just like Integer i = null;. Integer object can be null while a native int cannot be.

提交回复
热议问题