Question: Java Question: Assume you are a software developer in a company. You receive the following problem statement and are tasked to design and implement the

Java Question:

Assume you are a software developer in a company. You receive the following problem statement and are tasked to design and implement the data model for it.

"Our company manages deliveries, such as letters and packages. Letters contain just text. Packages contain one or multiple items. The items could be anything that can be shipped. Items must be represented as an interface in the application with a single method that returns the description of the item. These deliveries are transported via cargo ships, cargo airplanes, and mail trucks. Each transport vehicle must have a load method that puts a delivery onto it."

  1. Design the interfaces and classes above using inheritance, abstract classes, and interfaces.
  2. Create a main method in which you create one object for each vehicle type defined above.
  3. Add an item of a named subclass of Item to a new package object. Load the package to the object of the first vehicle type.
  4. Add an item using an anonymous class to a new package object. Load the package to the object of the second vehicle type.
  5. Finally, add an item using a lambda expression to a new package object. Load that package to the object of the third vehicle type.

note: if possible please design a code different from one already posted on chegg

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!