Question: 1a. Declare an ArrayList called primes that stores the first 5 prime integers (2, 3, 5, 7, 11). 1b. Given the ArrayList called primes that
1a. Declare an ArrayList called primes that stores the first 5 prime integers (2, 3, 5, 7, 11).
1b. Given the ArrayList called primes that is defined in #1a, write a loop to print its elements in reverse order, starting with the last element
3. What does the ArrayList called names contain after the following statements?
ArrayList
names.add("Bob");
names.add(0, "Ann");
names.remove(1);
names.add("Cal");
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
