title: Instantiate an object of a class where the class is given via generics
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/75175/create-instance-of-generic-type-in-java">Create instance of generic type in Java?</a>  </p>
  </blockquote>
  
  
  
  <p>I have some code:</p>
  
  <pre><code>public class foo&lt;K&gt; {
      public void bar() {
          K cheese = new K();
          // stuff
      }
  }
  </code></pre>
  
  <p>This does not compile and Intellij's linter tells me <code>Type parameter 'K' cannot be instantiated directly</code>.</p>
  
  <p>How would I instance a new copy of <code>K</code>.</p>