MrMistreater

Delegate example

May 9th, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.24 KB | None | 0 0
  1. delegate string DelegateTest(string str);
  2.  
  3. DelegateTest delTest = new DelegateTest(Class1.Hello);
  4. Console.WriteLine(delTest("LOL"));
  5.  
  6. class Class1{
  7.     ...
  8.     public static string Hello(string msg) {
  9.          return "Hello " + msg;
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment