This is my Java program , where i am setting the Objects with in the for loop as shown 

```
ArrayList list = new ArrayList();
for(int j = 0;j<=4;j++)
{
Student student = new Student();
studunt.name="Ravi";
list.add(student);
}

```

**Then i need to parse this List and set it inside a StudentResponse ( Which is consisting of a Student[])**

```
StudentResponse  response = new StudentResponse();

    for (int in = 0; in < list.size(); in++) {
    {
    Student data = (TopListsQuoteData) list.get(in);
    response. student[in] = data;
    }

```

**This is my StudentResponse class**

```
public class StudentResponse 
{
public  Student[] student;
}

```

I am getting a NullPointerException at this line 
response. student[in] = data;

Please help , Thanks .