What does a lambda expression mean? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What does a lambda expression mean?

I just completed Java course but still have no idea what it means.

29th Nov 2017, 2:00 AM
Rizan
Rizan - avatar
2 Answers
+ 1
It's a function. (x, y) -> x * y is a lambda expression that's the same as a function public int myFunction(int x, int y){ return x * y; } Except that the lambda doesn't have a name, works on more than just `int`, and you can carry it around in variables easily.
29th Nov 2017, 2:15 AM
Schindlabua
Schindlabua - avatar
+ 1
Oh! Okay:)
29th Nov 2017, 2:17 AM
Rizan
Rizan - avatar