title: Create instance of generic type whose constructor requires a parameter?
body: <p>If <code>BaseFruit</code> has a constructor that accepts an <code>int weight</code>, can I instantiate a piece of fruit in a generic method like this?</p>
  
  <pre><code>public void AddFruit&lt;T&gt;()where T: BaseFruit{
      BaseFruit fruit = new T(weight); /*new Apple(150);*/
      fruit.Enlist(fruitManager);
  }
  </code></pre>
  
  <p>An example is added behind comments. It seems I can only do this if I give <code>BaseFruit</code> a parameterless constructor and then fill in everything through member variables. In my real code (not about fruit) this is rather impractical.</p>
  
  <p><strong>-Update-</strong><br>
  So it seems it can't be solved by constraints in any way then. From the answers there are three candidate solutions:</p>
  
  <ul>
  <li>Factory Pattern</li>
  <li>Reflection</li>
  <li>Activator</li>
  </ul>
  
  <p>I tend to think reflection is the least clean one, but I can't decide between the other two.</p>