generics in java : identify Type of T
<p>I am writing some generic <code>DAO</code> as follows</p>

<pre><code>public class MyGenericDAO&lt;T&gt; {

      Class&lt;T&gt; clazz;

      public void doSome(){
        for(int =0 ;i&lt;14;i++){
            //do something
           }
      }
}
</code></pre>

<p>Now i want to initialize clazz based on Type of T? .How can i do it?</p>

<p>For example if someone does <code>MyGenericDAO&lt;Xyz&gt; = new MyGenericDAO&lt;MyGenericDAO&gt;()</code>  then type of <code>T</code>  should be <code>Xyz</code>.</p>

<p>How can i do it?Is it possible without refelection?</p>
