Get specific ArrayList item

Viewed 607144
public static ArrayList mainList = someList;

How can I get a specific item from this ArrayList? mainList[3]?

8 Answers

Try:

ArrayListname.get(index);

Where index is the position in the index and ArrayListname is the name of the Arraylist as in your case is mainList.

Related