Java Reflection List Iterate
<pre><code>private static Void createTbody(List object) {

    Iterator hritr = object.iterator();
        while(hritr.hasNext()) {

        UserDto users = (UserDto)hritr.next();
        users.userId;
        users.userName;
    }
}
</code></pre>

<p>DtoClass::</p>

<p>UserDto</p>

<pre><code>public class UserDto {

    public String userName;
    public String userId;

}
</code></pre>

<p>In the above code i dont have any problem...</p>

<p>put in my <code>createTbody</code> function i dont know the <code>UserDto</code> Class at compile time...It should dynamic class.This class name i will get through reflection.</p>

<pre><code>UserDto users = (UserDto)hritr.next();
</code></pre>

<p>Why because is, <code>private static Void createTbody(List object)</code> object may contain List of <code>CustomerDto</code>,<code>UserDto</code>etc...</p>
