Lesson 5. Interfaces and Polymorphism

In this lesson you will learn about:

• sorting

• interfaces

• the Comparable interface

if statements

• enumerated types using enum

• polymorphism

Sorting: Preparation

image

The school needs a report of all course sessions. You must sort the report first by department, then by course number. This implies that all courses for a given department will be listed together. The groups of departments will be ordered in ascending alphabetical order. Within a department, the sessions will be ordered by course number.

To get started, get a simple report working of all course sessions. Don't worry yet about its order.

Get Agile Java™: Crafting Code with Test-Driven Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.