Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,20 @@
import module java.base;
public final class HigherOrderFunctions {
public static void main() {
Function<Integer, Integer> square = n -> n * n;
Function<Integer, Integer> cube = n -> n * n * n;
BiConsumer<String, Function<Integer, Integer>> demonstration = (s, f) -> {
IO.print(s + " => ");
IntStream.rangeClosed(1, 9).forEach( i -> IO.print("%4s".formatted(f.apply(i))) );
IO.println();
};
demonstration.accept("Squares", square);
demonstration.accept("Cubes ", cube);
}
}