Any reason to prefer getClass() over instanceof when generating .equals()?
Josh Bloch favors your approach: The reason that I favor the instanceof approach is that when you use the getClass approach, you have the restriction that objects are only equal to other objects of the same class, the same run time type. If you extend a class and add a couple of innocuous methods to … Read more