Question: Introduction To Java Using The ArrayList Class: Learning Objectives: Using the ArrayList class (for more flexible collection of variables). Using The ArrayList Class Write some

Introduction To Java Using The ArrayList Class: Learning Objectives: Using the ArrayList class (for more flexible collection of variables). Using The ArrayList Class Write some Java code that creates an ArrayList to store Strings. Use the add method to add six items (e.g. animals, planets, colors, friends, drinks). Print the total number of elements in your ArrayList. | Use an enhanced for loop to print the elements in your ArrayList one at a time. Remove the item at index position 1. Print the contents of your ArrayList now to confirm that this worked. Replace the item in the fifth position with "Greg". Print the contents of your ArrayList now to confirm that this worked. Add two new elements to your ArrayList (one at the end and one at the start). Print the contents of your ArrayList now to confirm that this worked. Use the clear() method to empty your list. Print the contents of your ArrayList now to confirm that this worked. Ten Dice Rolls In And ArrayList Write some Java code that creates an ArrayList to store ten dice rolls. You should ideally use a four loop to make your code efficient and easy to follow. Is It In My ArrayList? Create an ArrayList of Halloween candy (and add five different candies to your list. Ask this user to enter a candy to search for. Print "Yes I found it" or "No its' not there
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
