Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 1
lambdas
What is lambdas and when is it good to use them?
2 Answers
+ 1
You can use lambdas to iterate over collections or sets. Lambdas are also alternative for anonymous inner classes, when overriden class implements interface Consumer, Consumable or Runnable. Lambdas are included in Java 8 and brings some functional programming. For example:
collection.forEach((e) -> {System.err.println(e.toString());})
0
Thanks!