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