1.
Q20: Put the following code in order to create a program that will declare and instantiate an ArrayList of 10 random values between 1 and 100 and then find the maximum value in the ArrayList.
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