Question: Programming Fundamentals II - JAVA Lab #7-Inheritance NAME Problem: Develop the 'Shape' application such that . Rectangle', 'Ellipse', and 'Triangle' classes inherit from the 'Shape'

Programming Fundamentals II - JAVA Lab #7-Inheritance NAME Problem: Develop the 'Shape' application such that . Rectangle', 'Ellipse', and 'Triangle' classes inherit from the 'Shape' class Develop the 'Square' and Circle' class where 'Square' inherits from 'Rectangle' and Circle, inherits from 'Ellipse' Triangle, has no derived class. For each class, implement the overridden methods 'draw', 'move', and 'erase'. Each method should only have an output statement such as "Rectangle draw method" that will be displayed when the method is invoked Implement the default constructors for each class with a corresponding message to be displayed when invoked. No initializations are required; that is, the output message will be the only executable statement in the constructors Do not implement any other methods for these classes ( i.e., 'toString', 'equals', getters and setters) Implement a 'ShapeTest' class which will instantiate an object of each class. . Exercise each of the 'draw', 'move, and ,erase, methods of each class .Remember to make sure that there is only a single class per file Lab 7 Shape ShapeTest Ellipse Triangle Rectangle Square Circle main) Shape s1 new Shape) Rectangle r1 = new Rectangle(); draw) move) In all 6 classes erase) All the rest s1.move() s1.erase0: s1.draw): r1.move): r1.erase: r1.draw all the rest
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
