
단 하나의 추상 메서드만 있는 인터페이스
@FuntionalInterface
public interface Comparator<T> {
	int compare(T o1, T o2);
	// ...
}(String a, String b) -> a.equals(b)함수형 인터페이스를 구현한 클래스의 인스턴스를 람다 표현식으로 작성해서 전달한다.
- 람다 표현식에서는 파라미터로 전달받은 변수 뿐 아니라, 람다 표현식 외부에서 정의된 변수 (
Free Variable) 역시 사용할 수 있다.- ⚠️ 람다 표현식에서 사용되는 자유 변수는 final 또는 final 같은 효력을 지녀야 한다!
(Car car) -> car.getCarName()
Car::getCarName| Functional Interface | Function Descriptor | 
|---|---|
| Predicate<T> | T → boolean | 
| Consumer<T> | T → void | 
| Function<T, R> | T → R | 
| Supplier<T> | () → T | 
| BiPredicate<L, R> | (L, R) → boolean | 
| BiConsumer<T, U> | (T, U) → void | 
| BiFunction<T, U, R> | (T, U) → R | 
| Functional Interface | Function Descriptor | Specific Interface | 
|---|---|---|
| Predicate<T> | T -> boolean | IntPredicate LongPredicate DoublePredicate | 
| Consumer<T> | T -> void | IntConsumer LongConsumer DoubleConsumer | 
| Function<T, R> | T -> R | IntFunction<R> IntToLongFunction IntToDoubleFunction LongFunction<R> LongToIntFunction LongToDoubleFunction DoubleFunction<R> DoubleToIntFunction DoubleToLongFunction ToIntFunction<T> ToLongFunction<T> ToDoubleFunction<T> | 
| Supplier<T> | () -> T | BooleanSupplier IntSupplier LongSupplier DoubleSupplier | 
| UnaryOperator<T> | T -> T | IntUnaryOperator LongUnaryOperator DoubleUnaryOperator | 
| BinaryOperator<T> | (T, T) -> T | IntBinaryOperator LongBinaryOperator DoubleBinaryOperator | 
| BiPredicate<T, U> | (T, U) -> boolean | |
| BiConsumer<T, U> | (T, U) -> void | ObjIntConsumer<T> ObjLongConsumer<T> ObjDoubleConsumer<T> | 
| BiFunction<T, U, R> | (T, U) -> R | ToIntBiFunction<T, U> ToLongBiFunction<T, U> ToDoubleBiFunction<T, U> |