Array Lists Flashcards

1
Q

how to create an array list

A

ArrayList name = new ArrayList ( );

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how to add to an array lis

A

name.add(item)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how to add to an array list at a particular index

A

name.add(index, item)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how to see if a list contains an item

A

name.contains(item)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how to get an item at a certain index

A

name.get(index)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how to clear all the elements from the list

A

name.clear()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how to clone all the elements from the list

A

name.clone()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how to get rid of an element at a specific index

A

name.remove(index)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to get the size of the element list

A

name.size()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly