Practice Quiz on Constructing and Looping through an ArrayList
-
Declare a variable named
words
that is an ArrayList of
String values, and initialize it to be an empty list.
-
Add three strings to the ArrayList you created above: “Sherlock”, “Holmes”,
and "Watson".
-
Write a for loop that prints the length of each string in the ArrayList you
created above.