Can you do object equals null?

It’s entirely possible for two distinct object instances to be “equal” according to their contract. And then there’s the minor detail that since equals is a method, if you try to invoke it on a null reference, you’ll get a NullPointerException .

Sizin İçin Seçtik  Can you use == for null?

Leave a Reply

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