리턴값1 [C#][Study][기초다지기] Action, Func, Predicate 1. 사용 목적 - 딜리게이트 선언의 불편함을 보완 ex) delegate 사용 delegate void DelegateFunction(); // 이렇게 매번 선언을 해줘야 하는 불편함이 있음 static void Main(string[] args) { DelegateFunction df = () => Console.WriteLine("실행"); // 아래 두가지 방법 중 하나로 실행 가능 df(); // 실행 방법 1 df.Invoke(); // 실행 방법 2 } ex) Action 사용 static void Main(string[] args) { Action ac = () => Console.WriteLine("실행"); ac(); ac.Invoke(); } - 이처럼 간결하게 나타낼 수 있다. 2... 2023. 9. 25. 이전 1 다음