익명함수(Anonymous functions)를 지칭하는 용어
익명함수
함수의 이름이 없는 함수를 말하고 일급객체라는 특징을 가지고 있다.
다른 객체들에 적용 가능한 연산을 모두 지원하는 개체를 가르키고 함수를 값으로 사용할 수 있으며 파라미터로 전달 및 변수에 대입과 같은 연산이 가능하다.
@FunctionalInterface
interface MyFunctionalInterface {
String test();
}
public class Lambda{
public static void main(String[] args) throws Throwable{
String str = "Bello";
MyFunctionalInterface func = () -> str.replaceAll("\\s"+"");
System.out.println(func.test());
}
}