One.
What is a generic interface? The previous example created so many classes that it was cumbersome.
The first thing to understand is that the interface is an abstract class, and after the declaration, the following class is implemented. The methods in the interface are the classes that are implemented. This combines the interfaces with generics. In the preceding chapters, you combine generics with classes, methods.
A generic definition on a class is a generic class that is defined on an interface and is a generic interface. (interface defined, must be implemented)
Here is a program to express the meaning of all written out, define interfaces, classes to implement, the main function to create objects. At the time of definition, the parameter type is indeterminate and is represented by generic T, but it must be specified when implemented.
Then there is further development, that is, when the class is implemented, it still cannot determine the type of the parameter until the object is created in the main function.
There is no problem with running this way.
The use of generic interfaces is divided into two types.
Java-preliminary Understanding-Common Object API (collection framework-generic-generic interface)