# `==` compares references, and no compiler will warn you

`new Registration("KA01AB1234") == new Registration("KA01AB1234")` is `false`. Java has no
operator overloading, so `==` on objects always means "same reference" and cannot be changed.
Value comparison is a method: `equals`.

Every collection uses it. Write a class with no `equals` and `list.contains(equalKey)` returns
`false` while the item sits in the list. The code compiles, and no warning is printed.

`hashCode` is the second half. `HashMap` compares hash codes before calling `equals`, so equal
objects with different hashes are never considered. Override `equals` and you must override
`hashCode` from the same fields.

Two more, both replacing things C++ gives you as operators: `toString` for anything you will
read in a log, and `compareTo` for ordering, since there is no `operator<`.
