For example:
int anInt = null;
fails at compile time but
public static void main(String[] args) {
for (int i = 0; i < 10;
Boxing partially hides the distinction between primitives and corresponding wrapper objects, but it doesn't remove it.
There are two distinctions which are not changed by boxing:
Occasionally, these differences can cause problems when using boxing.
Some points to remember :
NullPointerException
.==
and equals
must be done with care.