title: Java Pass instance type of Object to generic class type parameter
body: <p>Is it possible to pass an Objects instance type as the type parameter of a generic? Something like the following:</p>
  
  <pre><code>Object obj = new Double(3.14); //Instance type Double
  
  //Could I do the following?
  Item&lt;obj.getInstanceType()&gt; item = new Item&lt;obj.getInstanceType()&gt;(obj);
  
  public class Item&lt;T&gt; {
      private T item;
      public Item(T item) {
          this.item = item
      }
      public T getItem() {
          return this.item;
      }
  }
  </code></pre>