Programming Language Concepts Jan-Apr 2009 Assignment 1 Due Monday, 16 February, 2009 1. Define an abstract class Shape with concrete subclasses Circle, Square, Rectangle such that every class that inherits from Shape MUST redefine the following methods: a. "public double sizeOf()" that returns some sensible parameter indicating the size of the object. b. "public boolean equals(Object o)" based on the defining characteristics of the object rather than on pointer equality. c. "public String toString()" to print out the defining characteristics of the object. 2. Consider the following interface: public interface Sortable { public int cmp(Sortable s); // return -1 if this < s, 0 if this = s, 1 if this > s } a. Write a method that sorts arrays of type Sortable (use any sorting algorithm of your choice). b. Extend the definition of Shape so that all objects that inherit from Shape are Sortable, and update the definitions of Circle, Square and Rectangle accordingly. ======================================================================