Why is null == null false in Java?

4 Answers. You can’t compare null to a boolean . They are different types one indicating a null reference pointer and the other one a false/not true value. Thus the answer is: No this expression is not even valid and if it was, it would be false .

Sizin İçin Seçtik  How do you check if an object is null in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

Why is null == null false in Java?

4 Answers. You can’t compare null to a boolean . They are different types one indicating a null reference pointer and the other one a false/not true value. Thus the answer is: No this expression is not even valid and if it was, it would be false .

Sizin İçin Seçtik  Portföy ne anlama geliyor?

Leave a Reply

Your email address will not be published. Required fields are marked *