title: Java: How to set a default for "T" in SomeClass<T>?
body: <p>Is there a way to specify a default type for a generic template?</p>
  
  <p>Let's say I have a <code>Monkey</code> class. Monkeys can live in different <code>Environment</code>s, such as <code>Jungle</code> or <code>Zoo</code>:</p>
  
  <pre>
      public class Monkey&lt;T extends Environment&gt;
      {
          T home;
          ...
  
          public T getHome()
          {
              return home;
          }  
      }
  </pre>
  
  <p>Is there a way to specify a default for <code>T</code>, so I can use the type <code>Monkey</code> instead of <code>Monkey&lt;?&gt;</code> without getting a compiler warning?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>In other words, is there a way to get rid of the "raw type" warning without having to explicitly suppress it?</p>