Currently learning Java so this may be a question resulting from lack of understanding of Java (while also learning Streams API)
In the declarations of function I often see two templated types for the return values. For instance below we have <T,U>
and also Collector<T,?,U>
. How should I read this? That it returns one of two possible types? This just looks odd since I've always thought functions return one type of data.
public static <T,U> Collector<T,?,U> reducing(U identity,
Function<? super T,? extends U> mapper,
BinaryOperator<U> op)