Question: (Enable Rectangle comparable) Rewrite the Rectangle class in Listing 13.3 to extend GeometricObject and implement the Comparable interface. Override the equals method in the Object
(Enable Rectangle comparable) Rewrite the Rectangle class in Listing 13.3 to extend GeometricObject and implement the Comparable interface. Override the equals method in the Object class. Two Rectangle objects are equal if their areas are the same. Draw the UML diagram that involves Rectangle, GeometricObject, and Comparable.
LISTING 13.3
Rectangle.java
public class Rectangle extends GeometricObject {
// Same as lines 3-51 in Listing 11.3, so omitted
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
