함수형 인터페이스 정리해두기

1
2
3
4
5
6
7
8
9
10
@FunctionalInterface
public interface Runnable {
public abstract void run();
}

```java
@FunctionalInterface
public interface Consumer<T> {
void accept(T t)
}
1
2
3
4
@FunctionalInterface
public interface Supplier<T> {
T get()
}
1
2
3
4
@FunctionalInterface
public interface Function<T, R> {
R apply(T t)
}
1
2
3
4
@FunctionalInterface
public interface Predicate<T> {
boolean test(T t)
}
Share