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.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact