Implement the example
programs shown in the lecture on Monday, 2 May.
These programs consist of
the following interfaces, classes and methods:
interface ObjectComparable
with method signature compare(Object obj).
class ObjectArray with the
methods append(Object obj), sort().
class MyObject with the
method compare(Object obj)
Building on these programs,
create an additional interface ObjectDisplayable to be implemented by the class
MyObject and that is used by the class ObjectArray in a public method
displayAll(). The interface ObjectDisplayable consists of a single method
signature void display() that is implemented in the class MyObject. Also
implement appropriate test programs.
You will have two packages. The first package contains the classes: ObjectComparable , ObjectDisplayable, ObjectArray. The second package contains the classes MyObject and TestObject.