Is == and Object equals the same?

In simple words, == checks if both objects point to the same memory location whereas . equals() evaluates to the comparison of values in the objects. If a class does not override the equals method, then by default, it uses the equals(Object o) method of the closest parent class that has overridden this method.

Sizin İçin Seçtik  Şans Topu 2 ye para veriyor mu?

Leave a Reply

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