I'm trying to write a java program that does, among other things, compare two arrays of booleans. The problem I run in to is that some of these boolean variables can be null (signifying yes, know, or unknown) but I'm not sure how to compare a variable to null. Using this code with IntelliJ gives me a syntax error:
It tells me that operator '==' cannot be applied to 'boolean', 'null.'
else if(firstAttributes[x] == null || secondAttributes[x] == null)
distance = distance + 0.5;
I distinctly remember being able to deal with this situation in some way, but I can't remember how. Any ideas?