What is the difference between equals () method and equality operator in Java?

Difference between equals() and “==” operator in Java Equals method can only be used with objects. Equality operator compares the object references when two objects are compared using equality operator. Equals method when overridden can do content comparison of two objects.

Sizin İçin Seçtik  How do you know if an object is equal?

Leave a Reply

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