// Tyler Mi // A class representing generic shape public abstract class Shape implements Comparable { private String name; // Sets the name of the Shape public Shape(String name) { this.name = name; } // Returns the area of the shape public abstract double area(); // Returns an int reprensenting how this Shape should // be ordered relative to the given Shape based on area // Will be sorted in ascending order of area public final int compareTo(Shape other) { return Double.compare(this.area(), other.area()); } // Returns a String representing the name and area // of the Shape public final String toString() { return name + " with area " + area(); } }