In this chapter, we will learn about parametric polymorphism and how Java 9 implements this object-oriented concept by allowing us to write generic code. We will start creating classes that use one constrained generic type. We will:
Understand parametric polymorphism
Learn the differences between parametric polymorphism and duck typing
Understand Java 9 generics and generic code
Declare an interface to be used as a type constraint
Declare a class that conforms to multiple interfaces
Declare subclasses that inherit the implementation of interfaces
Create exception classes
Declare a class that works with a constrained generic type
Use a generic class for multiple compatible types