How to obey contract of equals() when deriving from abstract class
In his book Effective Java, Joshua Bloch writes about the pitfalls that occur with the contract of equals() when derived classes add additional fields to the check. Normally, this would break the symmetry, but Bloch states that “you can add a value component to a subclass of an abstract class without violating the equals contract”. Obviously this is true because…
Read more