람다함수

Popconnect·2023년 3월 23일

함수형 구조

객체선언 = () -> { 출력부 }  //다항
객체선언 = () -> 출력부

람다의 추상메서드는 하나여야한다

@FunctionalInterface 
public interface MyFunctionalInter {
void method1();
//void method2(); ///2개는 에러

,,,

MyFunctionalInter f = null;
		f = () -> {
			System.out.println("method 호출");
		};
profile
Programmer

0개의 댓글