Can someone please tell me if there is an equivalent for Python\'s lambda functions in Java?
With the release of Java 8, lambda-expression is now available. And the lambda function in java is actually "more powerful" than the python ones.
In Python, lambda-expression may only have a single expression for its body, and no return
statement is permitted. In Java, you can do something like this: (int a, int b) -> { return a * b; };
and other optional things as well.
Java 8 also introduces another interface called the Function Interface
. You might want to check that out as well.