5.2k views
5 votes
Invoking _____ returns the first element in an ArrayList x.

x.get(1)
x.get()
x.get(0)
x.first()

1 Answer

5 votes

Answer:

x.get(0).

Step-by-step explanation:

Arraylist provides dynamic arrays in Java means arrays that can resize themselves if needed.

We have arraylist x.We want to return the first element which will be stored at the index 0 because the indexing starts from 0.So 0 is the first index.

get(int index):- It return the element from the list at the specified index.

So we conclude the answer to this question is x.get(0).