I was looking at Java8's functional Interface Consumer. I can see a default method andThen. I understood that the method is used to chain consumer's together. Below is the code of andThen method:
default Consumer<T> andThen(Consumer<? super T> after) {
Objects.requireNonNull(after);
return (T t) -> { accept(t); after.accept(t); };
}
Question: Why only the type & SuperType of element (? super T) are allowed in the Consumer argument of andThen method. I want to understand the purpose of the usage here.
I would help me in improving my understanding of Generics.