ArrayLists Flashcards

1
Q

initialize arraylist

A

ArrayList<type> name = new ArrayList<type>();</type></type>

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

Access an Item in arraylist

A

name.get(index);

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

Change an Item in arraylist

A

name.set(index, replacement);

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

Remove an Item in arraylist

A

name.remove(index);

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

Remove all Items in arraylist

A

name.clear();

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

Get length in arraylist

A

name.size();

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

Add item to the end in arraylist

A

name.add(value);

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

Add to specific spot in arraylist

A

name.add(index, value);

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