boolean
is a primitive type, and therefore can not be null.
Its boxed type, Boolean
, can be null.
The function is probably returning a Boolean
as opposed to a boolean
, so assigning the result to a Boolean
-type variable will allow you to test for nullity.