private static Void createTbody(List object) {
Iterator hritr = object.iterator();
while(hritr.hasNext()) {
UserDto users = (UserDto)hritr.next();
users.userId;
users.userName;
}
}
DtoClass::
UserDto
public class UserDto {
public String userName;
public String userId;
}
In the above code i dont have any problem...
put in my createTbody function i dont know the UserDto Class at compile time...It should dynamic class.This class name i will get through reflection.
UserDto users = (UserDto)hritr.next();
Why because is, private static Void createTbody(List object) object may contain List of CustomerDto,UserDtoetc...
userNameanduserIdfields...