|
Java™ by example!
|
|
|
Why do I get a NullPointerException when auto-unboxing?
This can happen when you cast a null to a primitive type. It can be hard to spot these types of errors: Main.java:
The reason for the NullPointerException is much clearer if you look at the equivalent:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|