lambdas | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

lambdas

What is lambdas and when is it good to use them?

13th Nov 2016, 7:53 PM
Ousmane Diaw
2 Respostas
+ 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());})
13th Nov 2016, 10:24 PM
Marcin Las
Marcin Las - avatar
0
Thanks!
13th Nov 2016, 10:28 PM
Ousmane Diaw