title: Java: Class<T> and Class: Difference when used from within/ outside of the class
body: <p>I have a class that needs to use a <code>Class&lt;T&gt;</code> parameter (see my previous semi-related <a href="https://stackoverflow.com/questions/2106874/java-instantiating-a-generic-class-with-no-default-constructor">question</a>). It is:</p>
  
  <pre><code>public class BaseTable&lt;T extends TableEntry&gt;
  {
      protected Class&lt;T&gt; mClass;
      ...
  
      public BaseTable(int rows, int cols, Class&lt;T&gt; clasz)
      {
          ...
          mClass = clasz;
      }
  
      public BaseTable(int rows, int cols)
      {
          this(rows, cols, StringTableEntry.class);
          //Does NOT compile:
          //expected [int, int, Class&lt;T&gt;], but got
          //[int, int, Class&lt;blah.blah.StringTableEntry&gt;]
      }
  ...
  }
  </code></pre>
  
  <p>I am wondering why the constructor (with 2 parameters) does not work, but when I am invoking the exact same thing from an external class, like this:</p>
  
  <pre><code>    mSomeTable = new BaseTable&lt;StringTableEntry&gt;(2, 2, StringTableEntry.class);
  </code></pre>
  
  <p>It compiles and runs without complaining. Why so, and how to work around this?</p>
  
  <p>Thanks!</p>