✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Consider a List L implemented with an ArrayList. Suppose the following operations are executed on the list:
List<String> L = new ArrayList<E>();
L.add(“Ned”);
L.add(0, “Jim”);
L.add(“Jim”);
L.add("Rex");
L.add(0, “Kim”);
L.add(“Bob”);
L.remove(2);
L.add(0, “Rex”);
L.add("Rex");
L.remove(0);
L.add("Ned");
After these statements, what would L.lastIndex("Rex"); return?