using System;
namespace TestCS {
class Program {
public delegate void MethodDelegate(string param);
private void privateMethod(string str) {
Console.Write(str);
}
public void GetMeth(out MethodDelegate md) {
md = privateMethod;
}
static void Main(string[] args) {
MethodDelegate myMethod;
Program program = new Program();
program.GetMeth(out myMethod);
myMethod("Hello");
Console.Write("_world");
Console.ReadKey();
}
}
}
Login in to like
Login in to comment