Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java: UML design, write interfaces and abstract class help? Q1. Write Java code to implement the UML diagram below. Note the following: a) All italic

Java: UML design, write interfaces and abstract class help?

image text in transcribed

Q1. Write Java code to implement the UML diagram below. Note the following: a) All italic classes are abstract. b) No need to include any method except those you have to include. c) The howToFly () method should print one line describing how an object flies. For example, a Copter will fly off the ground vertically using rotor blades." d) Don't implement howToFly () in the Plane class (as it will make little sense because subclasses fly differently). Instead, implement howToFly () in both Copter and Boing777. e) Cars are comparable based on their manufacturing year. f) You don't have to write the body of all classes (e.g. Train would be an empty class), but feel free to adjust the design and add any class members of your choice. > Comparable > Flyable +howToFly(): String > Cloneable Vehicle Bird +year:int +age: int 4 Car Dove Train Plane Penguin +Car(year:int) +Doveage:int) Copter Boing777 Q2. Write a test program to: a) Create an array of cars and sort them using Arrays.sort(). Can we sort objects of the other classes using the same technique? b) Create a dove and clone it. Try to change the age attribute for one dove and see if it changes in the cloned dove

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions