I have a question about overriding the equals method in Java. In my book, I have the following example:
equals
public class Dog{ private String na
I think that your demo class is missing a hashCode() method. The two objects can only be equal if their call to an overridden hashCode() is equal. (the same integer value).
I'm pretty sure you need both to guarantee this equation.