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 = new 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!