ArrayList Methods Flashcards

Learn the ArrayList methods very well :-) ! https://www.geeksforgeeks.org/arraylist-in-java/

1
Q

add()

A

this method returns a boolean and adds the specified object to the end of the arraylist
https://www.geeksforgeeks.org/java-util-arraylist-add-method-java/

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

add(int i, object k)

A

this method returns void and adds the specified object at the given index (integer i). subsequent objects are shifted plus 1
https://www.geeksforgeeks.org/java-util-arraylist-add-method-java/

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

get(int i)

A

the get method returns the object at the specified index of the arraylist or an IndexOutOfBounds exception if the object is not found at the specified index
https://www.geeksforgeeks.org/arraylist-get-method-java-examples/

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

forEach​(Consumer action):

A

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

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