public boolean equals(Object otherObject) { if (otherObject == null) return false; else if (getClass() != otherObject.getClass()) return false; else { DiscountSale otherSale = (DiscountSale) otherObject; return (discount == otherSale.getDiscount() && getName().equals(otherSale.getName()) && (getPrice() == otherSale.getPrice())); } }
public DiscountSale(DiscountSale originalObject) { /** 구현 하시오 * */ if (originalObject == null) { System.out.println("Error: null Sale object."); System.exit(0); } // else setName(originalObject.getName()); setPrice(originalObject.getPrice()); }
public DiscountSale(DiscountSale originalObject) { super(originalObject.getName(), originalObject.getPrice()); discount = originalObject.getDiscount(); }