arraylist add new element to end

Solutions on MaxInterview for arraylist add new element to end by the best coders in the world

showing results for - "arraylist add new element to end"
Raul
10 Oct 2016
1    //add to the end of the list
2    stringList.add(random);
3
4    //add to the beginning of the list
5    stringList.add(0,  random);
6
7    //replace the element at index 4 with random
8    stringList.set(4, random);
9
10    //remove the element at index 5
11    stringList.remove(5);
12
13    //remove all elements from the list
14    stringList.clear();
15