Current location - Training Enrollment Network - Mathematics courses - What is a java lambda expression?
What is a java lambda expression?
Lambda expression is a new feature provided in JAVA8, which supports JAVA and simple "functional programming". It is an anonymous function, and Lambda expression is named based on λ calculus in mathematics, which directly corresponds to lambda abstraction. It is an anonymous function, that is, a function without a function name.

Function interface:

This is the key point to understand Lambda expression, and it is also the "matrix" to generate lambda expression. Here we quote a simple statement: a function interface is an interface with only one abstract method (excluding the methods in the object).

This needs to be explained, that is, any interface in Java where an Object comes from Object will naturally inherit the methods in Object, but the methods in Object should be excluded when judging whether it is a function interface.