Written by Jonas Altrock (ew20b126@technikum-wien.at).
The fourth exercise is about abstract classes and interfaces.
An abstract class is a class that cannot be used to make an object, i.e. no object of this class can be instantiated, only of its non-abstract subclasses. An abstract class can have abstract methods, which have no implementation and must be implemented by the subclasses.
An interface is a class-like type description that only contains method signatures, without any implementations. This is used to define behavioral contracts that may be fulfilled by many different classes. Accepting an interface type as an argument means we know that the passed object has certain methods, which is enough to build algorithms that use the object.
We are asked to implement the concrete subclasses for these four abstract classes:
We also have to implement the methods to make the class MusicLandscape.entities.Track conform to the interface MusicLandscape.util.ConsoleScanable
The most interesting part of the assignment is probably the implementation of Track.scan.
The abstract classes to implement comparators will be replace by interface implementations in the next exercise,
and the formatters will only be relevant again in the LabWork assignment.