Question: Write a Fresh Produce class which extends class Product. This Fresh Produce class should: Have an instance data member expirationDate of String, which records

Write a Fresh Produce class which extends class Product. This Fresh Produce class should: Have an instance data member expirationDate of String, which records the expiration date of such a product in a string; a default constructor (O parameters); A constructor with three parameters to initialize all data members; Override the toString method to return a string including id, price, and expiration date. You must take advantage of the toString() of the parent class. All instance data members should be private and all constructors and methods should be public unless specified otherwise. Comments may be omitted. Here is the class diagram of class Product (You don't build this class, but its child class FreshProduce): Product id: String price double + Product() + Product(id: String, price double) + getID() : String + getPrice() : double + toString() : String Assume the toString() of Product will return a string like this: ID: id of this obj; Price: $xxx.xx
Step by Step Solution
There are 3 Steps involved in it
Heres the implementation of the FreshProduce class in Java extending the Product class public class ... View full answer
Get step-by-step solutions from verified subject matter experts
