Null can be cast to any type as it can be assigned to an object reference of that type. It, in a way, can act as every type, except for the fact that it is useless when trying to do field/method access(where a NullPointerException will be thrown) and is not every type. Note that null instanceof Foo
is always false, no matter what foo
is.