Advertisement
d0ntth1nc

Untitled

Jan 10th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. class MainClass
  2.     {
  3.         public static void Main ()
  4.         {
  5.             Action<dynamic[]> act = FirstMethod;
  6.             dynamic[] args = { 1, 2 };
  7.             act (args);
  8.  
  9.             act = SecondMethod;
  10.             act (args);
  11.         }
  12.  
  13.         private static void FirstMethod(params dynamic[] args)
  14.         {
  15.             foreach (var arg in args) {
  16.             }
  17.             Console.WriteLine (args[0]);
  18.         }
  19.  
  20.         private static void SecondMethod(params dynamic[] args)
  21.         {
  22.             foreach (var arg in args) {
  23.             }
  24.             Console.WriteLine (args[1]);
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement