Q:

How to get 2 ArrayList in different class?

I have two class Student and Worker.
In that I define two ArrayList and have a getter for each class.
Worker Class:
private List<Worker> WorkerList = new ArrayList<Worker>();

public List<Worker> getWorkerList() {
    return WorkerList;
}

public Worker(String first, String last, float WeekSalary,
        float WorkingHours) {
    super(first, last);
    this.setWeekSalary(WeekSalary);
    this.setWorkingHoursPerDay(WorkingHours);
    // TODO Auto-generated constructor stub
}

Student Class:
private List<Student> StudentList = new ArrayList<Student>();

public Student(String first, String last, int gradeValue) {
    super(first, last);
    this.setGrade(gradeValue);
}

public List<Student> getStudentList() {
    return StudentList;
}

The problem here is how can I get these two ArrayList from another class? For example a MergeClass?

A:

public class MergeClass<T>
{
    private List<T> a;
    private List<T> b;
    public MergeClass(List<T> a, List<T> b)
    {
        this.a = a;
        this.b = b;
    }

    public void merge()
    {
       //
    }
}

From what I understand is that what you need. Hope that it can help.

