Skip to main content
PProfileMatch
← Path

Advanced Java · Java Generics, Lambdas and Streams API Explained with Examples

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Bike shop: sorting the toolbox

Trick to keep in mind+3 XP

Count the arrows: Function is one in, one out. Supplier has no input, Consumer has no output.

Each functional interface is named after its shape. Function<T, R> takes a T and hands back an R, which may be a different type. Supplier takes nothing and produces something. Consumer takes something and returns nothing. Predicate takes something and answers true or false, and UnaryOperator is a Function whose input and output types must match.

Read it once, then a question tests whether the trick stuck.