The short answer The simple answer is: No, there is no generic means to determine that an object is equal to another in the sense you mean . The exception is when you are strictly thinking of an object being typeless.1 Şub 2015
Read moreWhy objects are not equal in JS?
As from The Definitive Guide to Javascript. Objects are not compared by value : two objects are not equal even if they have the same properties and values. This is true of arrays too: even if they have the same values in the same order.
Read moreHow do you know if an object has equality?
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.
Read moreHow do you make two lists equal in Java?
List equals() Method in Java with Examples. This method is used to compare two lists. It compares the lists as, both lists should have the same size, and all corresponding pairs of elements in the two lists are equal.2 Oca 2019
Read moreCan you use == when comparing strings?
One can use == operators for reference comparison (address comparison) and . equals() method for content comparison. In simple words, == checks if both objects point to the same memory location whereas .
Read moreCan you use == to compare objects?
In Java, the == operator compares that two references are identical or not . Whereas the equals() method compares two objects. Objects are equal when they have the same state (usually comparing variables).
Read moreWhy can’t you use == for strings in Java?
Do not use the == operator to compare Strings operators. These operators actually test references, and since multiple String objects can represent the same String , this is liable to give the wrong answer. Instead, use the String.
Read more