This is a code taken from Cracking the coding interview.I didnt understand line number 4 and 5. From what I can see ,it is arraylist of arraylist but bit confused about how it is defined. Please explain me whats actually happening in these lines.
1 public class CallHandler {
2 static final int LEVELS = 3; // we have 3 levels of employees
3 static final int NUM_FRESHERS = 5; // we have 5 freshers
4 ArrayList<Employee>[] employeeLevels = new ArrayList[LEVELS];
5 // queues for each call’s rank
6 Queue<Call>[] callQueues = new LinkedList[LEVELS];
7
8 public CallHandler() { ... }
9
10 Employee getCallHandler(Call call) {
11 for (int level = call.rank; level < LEVELS - 1; level++) {
12 ArrayList<Employee> employeeLevel = employeeLevels[level];
13 for (Employee emp : employeeLevel) {
14 if (emp.free) {
15 return emp;
16 }
17 }
18 }
19 return null;
20 }