Java/Lambda Expressions

[Lambda Expressions] 소개

고인돌개발자 2021. 5. 23. 17:13

학습목표 : Lamda Expressions 에 대한 개념을 정의할 수 있다.


Java tutorial - Lamda Expressions 

 

https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html#approach1

 

Lambda Expressions (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available. See Java Language Changes for a summary of updated

docs.oracle.com

 

One issue with anonymous classes is that if the implementation of your anonymous class is very simple, such as an interface that contains only one method, then the syntax of anonymous classes may seem unwieldy and unclear. In these cases, you're usually trying to pass functionality as an argument to another method, such as what action should be taken when someone clicks a button. Lambda expressions enable you to do this, to treat functionality as method argument, or code as data.

 

Lamda Expressions(람다식)은 anonymous classes(익명 클랙스) 를 단순화 시켜준다.