Question: Using Java programming language. Exercise Design a hierarchy containing an interface, an abstract class and concrete classes that encapsulate a geometric shape On top of

Using Java programming language.

Using Java programming language. Exercise Design a hierarchy containing an interface, an

Exercise Design a hierarchy containing an interface, an abstract class and concrete classes that encapsulate a geometric shape On top of the hierarchy, consists of an interface that includes common members to all geometric shapes (the common nam: " Geometric Shape", getname() etc. The following elements in the hierarchy will be at least two abstract classes MyTwoD Shapes and MyThreeD Shapes. In this lab we consider only TwoD Shapes class. This class should declare all the fields, and implement all methods that are common to all 2D shapes (start point, width, height etc..). It should also include abstract methods that need to be implemented by its subclasses (getArea), draw(), getName(), etc. At the bottom of the hierarchy there will be two concrete classes that implement two common 2D shapes Oval and Rectangle Write also a client class for testing the hierarchy you have designed. Your client class should make use of polymorphism

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!