37.1k views
3 votes
The ArrayList class ____ method removes an item from an ArrayList at a specified location.

a.
erase

b.
remove

c.
delete

d.
get

User Danyim
by
6.4k points

1 Answer

5 votes

Answer:

remove

Step-by-step explanation:

The function used to remove the element in the ArrayList at specific index is remove.

Syntax:

remove(int index)

it used index to remove the element.

ArrayList index start from the index zero. So, if the we enter the index 0 it means remove the element at first position.

for example:

array.remove(1); it remove the element at index 1 from the ArrayList name array.

User Djoll
by
5.5k points