title: How do I get an inner class to inherit enclosing class' generic type?
body: <p>I'm using Java 6.  </p>
  
  <p>I'm having trouble getting my inner class to use the same generic class as its enclosing class.  Currently I have</p>
  
  <pre><code>public class TernarySearchTree &lt; T &gt; {
      ...
      protected class TSTNode &lt; T &gt; {
          // index values for accessing relatives array
          protected static final int PARENT = 0, LOKID = 1, EQKID = 2, HIKID = 3; 
          protected char splitchar;
          protected TSTNode &lt; T &gt; [] relatives;
          private T data;
  
          protected TSTNode(char splitchar, TSTNode &lt; T &gt; parent) {
              this.splitchar = splitchar;
              relatives = new TSTNode[4];
              relatives[PARENT] = parent;
          }
      }
  }
  </code></pre>
  
  <p>Right now I get the warning</p>
  
  <blockquote>
    <p>The type parameter T is hiding the type T</p>
  </blockquote>
  
  <p>If I remove the type parameter from the inner class (i.e. remove the <code>&lt;T&gt;</code> from teh <code>protected class TSTNode&lt;T&gt;</code> line), then I get a compile error on the line <code>relatives = new TSTNode[4]</code>.  </p>
  
  <p>How can I make everything right?</p>