title: How do I create a new object of a generic type?
body: <p>I've got this class:</p>
  
  <pre><code>public class A&lt;T&gt; {
     protected T something = new T();
     ...
  }
  </code></pre>
  
  <p>Of course <code>new T()</code> is not possible. What can I do instead?</p>
  
  <p>I must not change the code where the constructor of this class is called, because this is done via reflection.</p>
  
  <p>Annother problem is how to get the Class object of a generic class. mymethod(A.class) worked, but now A has got the parameter T.</p>