The purpose of this exercise is to understand the concept of Java interfaces (what is it and when to use it), and learn how to create and implement multiple interfaces.
An example is given with a Penguin
class (extending a Bird
class), which implements a Swim
interface.
The Penguin
class overrrides the methods from the Swim
interface.
The target is to get inspired from this example and create a Eagle
class (extending a Bird
abstract class),
which implements a Fly
interface.
In the main
method from the Nature
class, all the methods from the implemented interface are called on an instance of Eagle
to check that everything works.