Introduction to OOP: Chapter 12: Implications of Inheritance [next] [previous] [audio] [real] [text]

Equality Testing

Equality testing can also use either value or pointer semantics.

Data fields can be compaired bitwise, or (better) recursively using whatever equality means for the data fields.

If programmers can define new meanings for equality, there is no guarantee that it even remains communtative. It can happen that x = y, but not y = x !

Intro OOP, Chapter 12, Slide 15