Question: Display Square, Rectangle, Parallelogram and triangle. code in java. display should be in * asterisks. and achieve all inheritance and ploymorphism. Step 1: Write a



Display Square, Rectangle, Parallelogram and triangle. code in java.
display should be in * asterisks. and achieve all inheritance and ploymorphism.
Step 1: Write a program as described in given class diagram. Shape data[1) rows columns filler : Boolean : int : int : char Constructors fill() : void display() : void display(Boolean data) : void Rectangle : int width height : int fill() : void You have achieved simple inheritance. Step 2: Add parallelogram class in previous program and extend from rectangle. Shape data[1] rows columns filler : Boolean : int : int : char Constructors fillo) : void display() : void display(Boolean data) : void Rectangle width height : int : int fill() : void Parallelogram indent : int fill() : void You have achieved multi-level inheritance. Step 3: Add Square class in previous program and extend from shape. Shape : Boolean data[][] rows columns filler : int : int : char : void Constructors fill() display() void display(Boolean data) : void Square Rectangle length : int width height : int : int fill() : void fill() : void Parallelogram indent : int fill() : void You have achieved hierarchical inheritance, overriding and overloading
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
