@Override public boolean equals(Object other) { if (!(other instanceof NumberData)) { return false; } if (other instanceof IntegerData) { return this.value == ((IntegerData) other).value; } else { return super.equals(other); } } }
@Override public boolean equals(Object other) { if (!(other instanceof NumberData)) { return false; } if (other instanceof IntegerData) { return this.value == ((IntegerData) other).value; } else { return super.equals(other); } } }
@Override public boolean equals(Object other) { if (other == null || !(other instanceof NumberData)) { return false; } if (other instanceof IntegerData) { return value == ((IntegerData) other).getValue(); } else { return super.equals(other); } }