Question: Design an interface named Colorable with a void method named how To Color (). Every class of a colorable object must implement the Colorable interface.

 Design an interface named Colorable with a void method named how

Design an interface named Colorable with a void method named how To Color (). Every class of a colorable object must implement the Colorable interface. Design a class named Square that extends Geometric Object and implements Colorable. Implement how To Color () to display the message Color all four sides. Write a test program that creates an array of five Geometric Objects. (new Square(2), new Circle(5), new Square(5), new Rectangle(3, 4), new Square(4.5)) For each object in the array, display its area and invoke it's how To Color () method if it is colorable. Area is 4.00 Color all four sides Area is 78.54 Area is 25.00 Color all four sides Area is 12.00 Area is 20.25 Color all four sides

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!