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 many hours does iPhone 12 mini battery last?

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  How do you replace an Optional null check in Java 8?

Leave a Reply

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