1.
Q21: Put the following code in order to create a method that will find the last occurrence of a target value and return the index of where that value is located.
add()
. Elements not yet added do not exist until explicitly inserted.
get(index)
which will be the index for the element to be accessed
arrayListName.get(index)
returns the value stored at that index
arrayListName.size() - 1
, inclusive; otherwise IndexOutOfBoundsException
occurs
set(index, value)
which will be the index for the element to be replaced