Assignment 6: Abstract Classes and Interfaces Practice

Objective: To get experience using abstract classes and interfaces.

Due: Before class on Friday.

Using Abstract Classes in the Game application (30)

To start, you can either:

Now for the refactoring of your code:

Using Interfaces (35)

Modify your Assignment 5 MediaItem class to implement the Comparable interface. It is up to you how you compare the items, although it should be something that makes sense.

Let Eclipse do most of the work for you. (Note that this would be a little more straightforward if you added that the class should implement an interface during creation of the class.) When you start typing to implement the Comparable interface, use control-spacebar to let Eclipse complete "Comparable", which will automatically add the parameter. Eclipse will give you an error about unimplemented methods; click on the error and select to implement methods. That will give you the method template--you still need to fill in the method.

In your driver program, sort and display the elements in the array.

Save your output in a file.

Turnin

Copy your project into an assign6 directory in your turnin directory.

Grading (65 pts)

You will be evaluated based on the following criteria: