초기 커밋.

This commit is contained in:
2025-03-05 10:21:10 +09:00
parent 3471914e64
commit 15885a2286
55 changed files with 1716 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
internal class Program
{
static void Main(string[] args)
{
new Program().Test();
}
// 델리게이트 정의
delegate int MyDelegate(string s);
void Test()
{
//델리게이트 객체 생성
MyDelegate m = new MyDelegate(StringToInt);
//델리게이트 객체를 메서드로 전달
Run(m);
}
// 델리게이트 대상이 되는 어떤 메서드
int StringToInt(string s)
{
return int.Parse(s);
}
// 델리게이트를 전달 받는 메서드
void Run(MyDelegate m)
{
// 델리게이트로부터 메서드 실행
int i = m("123");
Console.WriteLine(i);
}
}