ArrayList Methods Flashcards
Learn the ArrayList methods very well :-) ! https://www.geeksforgeeks.org/arraylist-in-java/
add()
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/
add(int i, object k)
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/
get(int i)
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/
forEach(Consumer action):
Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.