title: get class of object and instantiate new instance
body: <p>I'm hoping to do something like:</p>
  
  <pre><code>SubClass c = var.getClass();
  SuperClass varCopy = new SubClass();
  </code></pre>
  
  <p>In other words, I know what the superclass of varCopy will be at compile time, but I'm not sure which subclass will be instantiated. Is there a way to do this in Java?</p>
  
  <p>Thanks!</p>