public static ArrayList mainList = someList;
How can I get a specific item from this ArrayList
? mainList[3]
?
As many have already told you:
mainList.get(3);
Be sure to check the ArrayList Javadoc.
Also, be careful with the arrays indices: in Java, the first element is at index 0
. So if you are trying to get the third element, your solution would be mainList.get(2);