title: C# delegate question
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2044301/what-is-delegate">What is Delegate?</a>  </p>
  </blockquote>
  
  
  
  <p>In C#, a delegate can be seen as both method name and type name. Is my understanding right?</p>
  
  <p>like "doShow[] items = new doShow[3];"  dowShow is type name.
  like "doshow(new Class1()....)"   dosShow is a method name/</p>
  
  <p>I get this conclusion by reading codes here:</p>
  
  <pre><code>public class TestDelegate
  {
      // define a datatype as a method taking a string returning void
      public delegate void doShow(String s);
  
      public static void Main(string[] args) 
      {
          // make an array of these methods
          doShow[] items = new doShow[3];
  
          items[0] = new doShow(new Class1().show);
          items[1] = new doShow(new Class2().display);
          items[2] = new doShow(Class3.staticDisplay);
  
          // call all items the same way
          for(int i = 0; i &lt; items.Length; i++) {
              items[i]("Hello World");
          }
      }
  }
  </code></pre>