Java basic learning content 9 (lambda expression)

Overview

Lambda expression: One of the notations for functions (= anonymous functions) that are defined without naming. Describe arguments and processing.

notation

Lambda expression(Basic grammar)


 Function<int> func1 = (int num) -> { return num + 1};
 Function<int> func2 = num -> { return num + 2};
 Function<int> func3 = num -> num + 3;

use

If you use a method that takes a lambda expression as an argument, you can pass a part of the process as an argument. ・ Stream related -ReplaceAll of ArrayList ・ Self-made method And so on… As an example, see (the above)

Recommended Posts

Java basic learning content 9 (lambda expression)
Java basic learning content 7 (exception)
Java basic learning content 5 (modifier)
Java Basic Learning Content 8 (Java API)
Java basic learning content 4 (repetition)
Java basic learning content 3 (operator / ternary operator)
Java basic learning content 2 (array / ArrayList)
[Java] Lambda expression
Java lambda expression
Java basic learning content 1 (literals, variables, constants)
java learning (conditional expression)
java neutral lambda expression 1
Java learning memo (basic)
Java 8 lambda expression Feature
java lambda expression memo
Java lambda expression [memo]
Studying Java 8 (lambda expression)
Review java8 ~ Lambda expression ~
Java lambda expression again
Java Basic Learning Content 6 (Inheritance / Abstract Class / Interface)
[Java] Functional interface / lambda expression
Java8 stream, lambda expression summary
Java learning (0)
What is a lambda expression (Java)
Now let's recap the Java lambda expression
For JAVA learning (2018-03-16-01)
Java basic grammar
Java basic grammar
Java basic knowledge 1
[Java] Basic structure
[Java] [Basic] Glossary
Java basic grammar
Java basic grammar
Hello Java Lambda
Java exercises [Basic]
java learning day 2
java learning day 1
How to use Java API with lambda expression
Java8 to start now ~ forEach and lambda expression ~
Java8 Lambda expression & Stream design pattern reconsideration --Command pattern -
Ruby learning points (basic)
Java learning 2 (learning calculation method)
java basic knowledge memo
Java learning memo (method)
Quarkus saves Java Lambda! ??
Java Learning (1)-Hello World
Understand Java 8 lambda expressions
Java basic date manipulation
JAVA learning history interface
Java basic naming conventions
About Java lambda expressions
Introduction to lambda expression
Explain Java 8 lambda expressions
Java learning memo (interface)
Getting Started with Legacy Java Engineers (Stream + Lambda Expression)
Java table expression injection
Java learning memo (inheritance)
[Java] Basic method notes
java regular expression summary
Java8 Lambda Expression & Stream Design Pattern Rethinking --Null Object Pattern -
Java8 Lambda expression & Stream design pattern reconsideration --Template Method pattern -