Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System;
  2. namespace App
  3. {
  4.     public class Test
  5.     {
  6.         public delegate int delegateTest(int x);
  7.  
  8.         public static int square(int x)
  9.         {
  10.             return x * x;
  11.         }
  12.     }
  13.  
  14.     class Program
  15.     {        
  16.         static void Main(string[] args)
  17.         {
  18.           Test.delegateTest del = Test.square;
  19.  
  20.           System.Console.WriteLine(del(20));
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement