Question: Java. Implement the application that keeps track of package deliveries to consumers. The application consists of the following classes: 1. Item: Create a class called
Java.
Implement the application that keeps track of package deliveries to consumers. The application consists of the following classes:
1. Item: Create a class called Item. The class has two member variables of type String named "name" and "description" and provides getter and setter methods for both.
2. Mail(abstract class): Implement an abstract class called "Mail". The class has a member variable of type String named address and a getter method for it.
3. Letter: Implement a class called "Letter" that inherits from "Mail". The class has one member variable of type String named contents.
4. Package: Implement a class called "Package" that inherits from Mail. The class has one member variable of typeItem[] named "items" and a getter method for it.
5. DeliveryTruck: Implement a class calledDeliveryTruckwith a single member variable of typeMail[]of length 10. Add the following method:
void load(Mail mail): This method stores the given mail argument at the next available spot in the member variable.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
