Question: Design an interface named Colorable with a void method naned howtoColor(). Design an interface named Areaable with a method med getrea() that returns double. Design
Design an interface named Colorable with a void method naned howtoColor(). Design an interface named Areaable with a method med getrea() that returns double. Design a class named Square that implements Colorable, Areaable, and comparable. Implement howtocolor to display the message Color all four sides". Implement getarea to calculate and return the square's area. Implement compareto to compare squares based on area. The Square class contains a protected data field side with getter and setter methods constructor for constructing a Square with a specified side, and another no-argument constructor that creates a Square with side-e. Design a driver class that create an array of five comparable objects. Then create five randon Square objects and store them in the array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
