Explore BrainMass
Share

Explore BrainMass

    inheritance hierarchy

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write 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).

    © BrainMass Inc. brainmass.com October 9, 2019, 7:42 pm ad1c9bdddf
    https://brainmass.com/computer-science/java/inheritance-hierarchy-126833

    Solution Summary

    The solution writes an inheritance hierarchy (in Java) for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square (see attachment).

    $2.19