Question: Write the output produced when the following method is passed each of the following lists: a. [10, 20, 30] b. [8, 2, 9, 7, 4]
Write the output produced when the following method is passed each of the following lists:

a. [10, 20, 30]
b. [8, 2, 9, 7, 4]
c. [-1, 3, 28, 17, 9, 33]
public static void mystery2 (ArrayList list) { for (int i = list.size () 1; i >= 0; i--) { if (i % 2 0) { %3D%3D list.add (list.get (i)); } else { list.add (0, list.get (i)) ; System.out.println (list);
Step by Step Solution
3.30 Rating (174 Votes )
There are 3 Steps involved in it
Output produced when the my... View full answer
Get step-by-step solutions from verified subject matter experts
