September 2018
Intermediate to advanced
802 pages
19h 30m
English
Since, as we have mentioned already, functions are often simple one-liners, they are often inlined when passed in as parameters, for example:
Consumer<Double> success = d -> System.out.println("Success: " + d);Consumer<Double> failure = d-> System.out.println("Failure: " + d);calculate(() -> 4, i -> i * 10.0 + 10, n -> n < 100, success, failure);
But one should not push it too far, as such inlining may decrease code readability.
Read now
Unlock full access