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

Paradoxes of Equality, Part 3

And if you add inheritance into the mix, the possibilities for paradoxical behavior increase even more.
class Parent {
	boolean equals (Object x) { ... }
}

class Child extends Parent {
	boolean equals (Object x) { ... }
}

Parent p;
Child c;

if (p.equals(c)) // will execute using the parent method

if (c.equals(p)) // will execute using the childs method
Intro OOP, Chapter 12, Slide 20