Can we use equals with 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  How do I check if a string is null in Java 8?

Leave a Reply

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