Introduction to OOP Chapter 12: Implications of substitution: next previous audio real text

Paradoxes of Equality, Part 2

Because equality is a message sent to the left argument, there is no guarantee that properties such as symmetry or transitivity are preserved:

class Foo {
	boolean equals (Object right) { ... }
}

Foo a, b;

if (a.equals(b))  // even if this is true

if (b.equals(a))  // no guarantee that this is true

Intro OOP, Chapter 12, Slide 19