How do you know if an object is equal?

Comparing objects with equals() If the two objects have the same values, equals() will return true . In the second comparison, equals() checks to see whether the passed object is null, or if it’s typed as a different class. If it’s a different class then the objects are not equal.

Sizin İçin Seçtik  Is CodePen a text editor?

Leave a Reply

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

How do you know if an object is equal?

Comparing objects with equals() If the two objects have the same values, equals() will return true . In the second comparison, equals() checks to see whether the passed object is null, or if it’s typed as a different class. If it’s a different class then the objects are not equal.

Sizin İçin Seçtik  What happens if you use == for String?

Leave a Reply

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