Array Lists Flashcards
1
Q
how to create an array list
A
ArrayList name = new ArrayList ( );
2
Q
how to add to an array lis
A
name.add(item)
3
Q
how to add to an array list at a particular index
A
name.add(index, item)
4
Q
how to see if a list contains an item
A
name.contains(item)
5
Q
how to get an item at a certain index
A
name.get(index)
6
Q
how to clear all the elements from the list
A
name.clear()
7
Q
how to clone all the elements from the list
A
name.clone()
8
Q
how to get rid of an element at a specific index
A
name.remove(index)
9
Q
how to get the size of the element list
A
name.size()