Question: Write an abstract class for colored shapes that has an abstract method that draws the shape. Provide a factory method that returns a random shape.
Write an abstract class for colored shapes that has an abstract method that draws the shape. Provide a factory method that returns a random shape. Create three derived classes; one for a red circle, one for a blue square, and a third one for a green rectangle twice as wide as it is high.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
