How can the following throw a NullPointerException?

John Zukowski

Since Java now does auto boxing and unboxing, if the Integer variable i is null, the assignment to j will throw a NullPointerException since the conversion to a primitive type will fail.

About | Sitemap | Contact
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.