title: Knowing type of generic in Java
body: <p>I have a generic class, says :</p>
  
  <pre><code>MyClass&lt;T&gt;
  </code></pre>
  
  <p>Inside a method of this class, I would like to test the type of T, for example :</p>
  
  <pre><code>void MyMethod()
  {
  
      if (T == String)
          ...
      if (T == int)
          ...
  }
  </code></pre>
  
  <p>how can I do that ?</p>
  
  <p>Thanks for your help</p>