+ 2
How to learn lambdas?
I read about it but can't understand :/
8 Answers
+ 1
https://www.youtube.com/playlist?list=PLqq-6Pq4lTTa9YGfyhyW2CqdtW9RtY-I3
This is super cool video series that teach you Lambdas in Java. This guy explains very well. I highly suggest you to watch this.
+ 7
I guess, there are no lambdas in Java.
Are you talking about python 3?
+ 2
Java 8???
+ 1
Yes, there are lambdas in Java.
https://www.tutorialspoint.com/java8/java8_lambda_expressions
0
There are Lambdas in Java. I suggest to check out some youtube videos. Thay are explaining easily and write code alongside teaching theory
0
Lambdas are basically just functions, that you don't name.
They should always return a value and are deleted after usage.
It's like saying
public static int foo (a, b, c) {
return a+b-c;
}
But you don't care about all the stuff you don't need there.
You just say
(a, b, c) => { return a+b-c;}
It is the same, but you spare all this unnecessary public static int foo
You could also use the function foo for a lambda replacement like so:
.filter(foo)
instead of
.filter((a) => { return (a == bar);})
But you can't use the lambda outside the function.