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  Can I use == for string?

Leave a Reply

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