1 <p> This equals method is checking to see if the argument is some incompatible type
2 (i.e., a class that is neither a supertype nor subtype of the class that defines
3 the equals method). For example, the Foo class might have an equals method
7 public boolean equals(Object o) {
9 return name.equals(((Foo)o).name);
10 else if (o instanceof String)
11 return name.equals(o);
15 <p>This is considered bad practice, as it makes it very hard to implement an equals method that
16 is symmetric and transitive. Without those properties, very unexpected behavoirs are possible.