Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Our company manages deliveries, such as letters and packages. Letters contain just text. Packages contain one or multiple items. The items could be anything
Java
"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. It 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 mail item onto it."
- Design the interfaces and classes above using inheritance, abstract classes, and classes with inheritance.
- Create a main method in which you create one object for each vehicle type defined above.
- Call the load method on each.
- Add an item of a named subclass of Item to the object of the first vehicle type.
- Add an item using an anonymous class to the object of the second vehicle type.
- Finally, add an item using a lambda expression to the object of the third vehicle type.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started