Question: Assignment 1: Write a block of code that creates an ArrayList of String objects that will hold the names of your favorite band. After populating
Assignment 1:




Write a block of code that creates an ArrayList of String objects that will hold the names of your favorite band. After populating the ArrayList, perform the following: 1. Print the name of the band including a proper phrase to make a complete sentence. 2. Print the size of the ArrayList using the ArrayList ".size()" method. Include a proper phrase to identify what is being outputted. Example: "The band has 6 members." 3. Use a separate for-each loop to traverse the ArrayList and print the name of each band member on a separate line.
Step by Step Solution
There are 3 Steps involved in it
Heres the code java import javautilArrayList public class FavoriteBand public static void mainString args Creating an ArrayList to hold the names of t... View full answer
Get step-by-step solutions from verified subject matter experts
