So I have a 2 element Object array in which 1st element should store an arrayList of student Objects and then pass the Object array as argument to another for example say "X" method And now accessing the arrayList elements from that Object array 1st element and add it to another list.
 what I have done is, In my code I have

```
List<Student> students = new ArrayList<>();
//And then I create student objects
//I have a For loop
 Student s = new Student( //add student object)
//Add student objects to list
students.add(s);
//Now for loop is done and now I assign Object array 1st element to students
 o[1]=students;
//pass the object array to a method
MainActivity.x(o); //This is from postExecute
//Method declaration in MAINACTIVITY class
//In main Program class List<Student> studentList = new ArrayList<>(); is declared
public void x(Object[] res)
{
  studentList.add((Student)res[1]);

}

```

The problem is was getting a class cast exception. I think there is something that I'm doing wrong. Thanks in advance.