java : I am getting only one element while parsing the values
<p>when this program is run , i am getting only one name , instead of two 
That is the output is Pavan only</p>

<pre><code>import java.util.ArrayList;
import java.util.List;

public class Work {

    public static void main(String args[]) {

        User user1 = new User();
        User user2 = new User();

        user1.setName("Pavan");
        user2.setName("Palla");

        List userItems = new ArrayList();
        userItems.add(user1);
        userItems.add(user2);

        UserlistItem[] userlistitem = new UserlistItem[userItems.size()];

        for (int i = 0; i &lt; userItems.size(); i++) {

            User user = (User) userItems.get(i);

            userlistitem[i] = new UserlistItem();

            userlistitem[i].setUser(user);

        }

        Userlist userlistm = new Userlist();
        userlistm.setUserlistItem(userlistitem);

        UserlistItem[] ravi = userlistm.getUserlistItem();

        Userlists lists = new Userlists();

        lists.setUserlist(new Userlist[] { userlistm });

        Userlist[] main = lists.getUserlist();

        for (int i = 0; i &lt; main.length; i++) {
            System.out.println("Pavan"
                    + main[i].getUserlistItem()[i].getUser().getName());
        }


}

public class User {

     private String      name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}


public class UserlistItem {
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    } 


}



import java.io.Serializable;

public class Userlist {

    private static final long serialVersionUID = 1L;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public UserlistItem[] getUserlistItem() {
        return UserlistItem;
    }

    public void setUserlistItem(UserlistItem[] userlistItem) {
        UserlistItem = userlistItem;
    }

    private String id;
    private UserlistItem[] UserlistItem;

}



public class Userlists {

    private Userlist[] userlist;

    public Userlist[] getUserlist() {
        return userlist;
    }

    public void setUserlist(Userlist[] userlist) {
        this.userlist = userlist;
    }

}
</code></pre>
