Question: 5. ArrayList, 15 points Write a static method called flip2 that takes an ArrayList of Strings as a parameter and then flips each successive pair

5. ArrayList, 15 points Write a static method called flip2 that takes an ArrayList of Strings as a parameter and then flips each successive pair of values in the list. For example, suppose that a variable called list stores the following sequence of values ["aa", "bb", "cc", "DDD", "happy", "snow"] and we make the following call flip (list); Afterwards the list should store the following sequence of values "cc", ["bb", "aa", "DDD" , "snow" , "happy"] If the list has extra values that are not part of a pair, those values are unchanged. For example, if the list had instead stored ["aa", "bb", The result would have been: "??", "cc", "DDD" , "happy", "snow" , "hometown" ] ["bb", "DDD", "cc", "snow", "happy", "hometown" ]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
