Create an inheritance hierarchy for classes


Discuss the below:

Q: Create an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Make the hierarchy as deep (i.e., as many levels) as possible. Specify the instance variables and methods for each class. The private instance variables of Quadrilateral should be the x-y coordinate pairs for the four endpoints of the Quadrilateral. Write a program that instantiates objects of your classes and outputs each object's area (except Quadrilateral).

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Create an inheritance hierarchy for classes
Reference No:- TGS01935461

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)