You can't assign null to an int
int anInt = null;
Java allows this since you are not assigning null to an int
System.out.println("" + getSomeVal()); //null was just converted to a srting and was printed
If you perform this, you can get the error
int anInt = getSomeVal();