232k views
3 votes
Assume that aList is a valid ArrayList containing the following:

Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh
Which of the following does not remove Wei from aList?

1. aList.remove("Wei");
2. aList.remove("Wei", 1);
3. aList.remove("Wei",0);

A. Statement I only B. Statement II only C. Statement III only D. Statements I and III only E. Statements II and III only

1 Answer

4 votes

Answer:

The correct answer is E. Statements II and III only.

Step-by-step explanation:

The ArrayList remove function receives two types of data explained below:

  • .remove(int index) when receives a number it deletes the item that is positioned on the index given.
  • .remove(Element E) when receives an Element it deletes only the item thas is equal than the element given.
User Shaneice
by
3.5k points