Class PerishableItem

java.lang.Object
Item
Snack
PerishableItem

public class PerishableItem extends Snack
(The Advanced Product) This class extends Snack It introduces a java.util.Date property for an expiration date It overrides the isExpired() method from the base class to check if today's date is past the item's expiration date
  • Constructor Details

    • PerishableItem

      public PerishableItem(String name, double price, boolean isVegan, Date expirationDate)
      Class constructor for perishable item
      Parameters:
      name - name of item
      price - price of item
      isVegan - true or false if it is vegan
      expirationDate - the date of expiration
  • Method Details