Question: In this assignment we will design an interface to enforce behavior in the AppleLogger class. We will also modify the equals method in the AppleShipment

In this assignment we will design an interface to enforce behavior in the AppleLogger class. We will also
modify the equals method in the AppleShipment class so that it is a true override of the equals method
inherited from the Object class.
Declare an " AppleShipmentManager" interface in the AppleLogger source file which enforces the
behavior of the following methods:
public void addShipment(AppleShipment shipment)
public void showShipments()
public ArrayList find(String typeSubstr)
Modify the AppleLogger class so that it implements this interface.
Modify the "equals" method in the AppleShipment class so that it accepts an Object parameter type
instead of an AppleShipment. Use the instanceof operator in the method to determine if the
parameter is an AppleShipment reference. If it is, assign it to a local AppleShipment variable with a
cast operation and then continue the check for equality as before (return false if the parameter is
not an AppleShipment reference).
Add an @Override annotation to the equals method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!