title: Type declaration based on type parameters in inner classes
body: <p>Does Java shadow type parameters? I am finding it hard to test for myself because Java generics do not get reified at run time.</p>
  
  <p>For example, given this code:</p>
  
  <pre><code>public class NestedGeneric&lt;T&gt; {
      private InnerGeneric&lt;T&gt; innerGenericInstance;
  
      private static class InnerGeneric&lt;T&gt; {
          public T innerGenericField;
      }
  
      NestedGeneric() {
      innerGenericInstance = new InnerGeneric&lt;T&gt;();
      }
  }
  </code></pre>
  
  <p>Both the below statements compile fine:</p>
  
  <pre><code>NestedGeneric&lt;Integer&gt; test1 = new NestedGeneric&lt;Integer&gt;();
  NestedGeneric.InnerGeneric&lt;String&gt; test2  = new NestedGeneric.InnerGeneric&lt;String&gt;();
  </code></pre>
  
  <p>When the <code>NestedGeneric</code> is passed a type parameter and its constructor called, what is <code>T</code>? Is it always going to be the same as the type parameter passed to <code>nestedGeneric</code>?</p>
  
  <p>In other words, can an outer classes type parameters be passed to an inner classes generic type declarations?</p>