title: can we create instance of a class at run time and invoke all methods of class through code?
body: <p>In an Interview Interviwer asked to me  <strong>can we create instance of a class at run time and invoke all methods of class through code?</strong>
  The sample code for the class TestClass is below</p>
  
  <pre><code>public class TestClass
  {
      public int ID
      {
          get;
          set;
      }
      public string Name
      {
          get;
          set;
      }
      public float Salary
      {
          get;
          set;
      }
      public string Department
      {
          get;
          set;
      }
      public int Add(int a, int b)
      {
          return a + b;
      }
      public int Sub(int a, int b)
      {
          return a - b;
      }
  }//end class
  </code></pre>
  
  <p>Now I want to create instance of this class at run time and call all its methods and properties at run time, can any one explain how can I archive this.
  2. what is the benefit/uses to call the method like this way?</p>