title: Instantiating object of type parameter
body: <p>I have got a template class as follows:</p>
  
  <pre><code>class MyClass&lt;T&gt;
  {
      T field;
      public void myMethod()
      {
         field = new T(); // gives compiler error
      }
  }
  </code></pre>
  
  <p>How do I create a new instance of T in my class?</p>