/** * Base class example * @author Brad Rippe */ public class BaseClass { /** * Indicates whether some other object is "equal to" this one. * @param obj the object to check for equality * @return true if the the obj is equal to this BaseClass, otherwise false */ public boolean equals(Object obj) { System.out.println("BaseClass Equals"); if(obj == null) return false; if(obj == this) return true; // instance of this type? if(!(obj instanceof BaseClass)) return false; // compare primitive types return true; } }