Write the output produced when the following method is passed each of the following lists: a. [72,

Question:

Write the output produced when the following method is passed each of the following lists:

public static void mystery3 (ArrayList list) { for (int i = list.size () 2; i > 0; i--) { %3D int a = list.get (i); int b = list.get (i + 1); list.set (i, a + b); System.out.println (list);

a. [72, 20]

b. [1, 2, 3, 4, 5, 6]

c. [10, 20, 30, 40]

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: