java : Parsing An ArrayList and setting them into a Object
<p>I have these two classes:</p>

<pre><code>class Student
{
String name;
String age ;
}

class Person
{

String name;
String age ;
String grade ;
}
</code></pre>

<p>In the code below, I am creating <code>Student</code> objects and setting them inside the <code>ArrayList</code>.  Once the data is set in the <code>ArrayList</code>, I need to parse that <code>ArrayList</code> and set the values in another object:</p>

<pre><code>public class Work {

    public static void main(String args[]) {

        List StudentItems = new ArrayList();

        Student stud1 = new Student();
        Student stud2 = new Student();

        stud1.name = "ABC";
        stud1.age = "28";
        stud2.name = "XYZ";
        stud2.age = "38";

        StudentItems.add(stud1);
        StudentItems.add(stud2);

        Person[] pers = new Person[StudentItems.size()];

        for (int i = 0; i &lt; StudentItems.size(); i++) {
            pers[i] = new Person();

// I am confused here , could anyone please help 

        }

    }
}
</code></pre>
