Solution to 888a: Generic methods with streams
See code at solutions/code/tutorialquestions/question888a
Compare your solution with the code in the sample solution.
The main thing to understand about the code for these questions is that generic type information for a method (e.g. of the form <S, T>
) comes before the return type of the method, and after any other keywords such as static
or public
.
The sample implementation of zip
, which uses IntStream
and mapToObj
, is worth studying carefully.