logo CodeStepByStep logo

mirror

Language/Type: Java ArrayList collections
Related Links:

Write a method named mirror that accepts an ArrayList of strings as a parameter and produces a mirrored copy of the list as output, with the original values followed by those same values in the opposite order. For example, if an ArrayList variable named list contains the values ["a", "b", "c"], after a call of mirror(list); it should contain ["a", "b", "c", "c", "b", "a"].

You may assume that the list is not null and that no element of the array is null.

Method: Write a Java method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.