Question: II. Write the java statements for an ArrayList 1a) Declare and initialize an empty ArrayList list that will hold words. Ib) Declare and initialize another
II. Write the java statements for an ArrayList 1a) Declare and initialize an empty ArrayList list that will hold words. Ib) Declare and initialize another empty ArrayList with a specific capacity of i 5. 1c) What are the sizes of i. The list you created in #1 a? ii, The list you created in #1 b? 1d) Add "some word" to the list made in #1 three times. le) Add the word "another" to index 2, then "and another" to index 0. 10) Write a line of code that will get and print the second element of the list. 1g) What is the size of the current list? lh) Remove first the 2nd and then the 4th elements of the list. li) Replace the 3rd item in the list with the word "Computer". What value is re
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
