java19 더 자바(java 8) - 함수형 인터페이스와 람다 함수형 인터페이스 (Functional Interface) 추상 메소드를 단 하나만 가지고 있는 인터페이스 @FuncationInterface 애노테이션을 가지고 있는 인터페이스 @FunctionalInterface public interface RunSomething { void doIt(); static void printName() { System.out.println("Kang"); } default void printAge() { System.out.println("30"); } } 이 인터페이스는 함수형 인터페이스가 아닌것 처럼 생겼지만 함수형 인터페이스가 맞다. 왜냐하면 추상 메소드를 단 하나만 가지고 있으며 @FuncationInterface 애노테이션을 가지고 있다. static이나 de.. 2021. 5. 10. 이전 1 2 3 4 다음