title: How do i switch pairs of strings in an arraylist?
body: <p>How would i flip each pair of values in a list?
  For example, If i have an arraylist 
  ["aa"", "bb"", "cc"", "DDD", "happy", "snow"].
   and wanted to the list afterwards to store ["bb"", "a"", "DDD", "cc"", "snow", "happy"]</p>
  
  <p>I tried using a for loop but didnt get anything when i called the method.</p>
  
  <pre><code> public static void flip2(ArrayList&lt;String&gt; list){
  
  
   for(int i =0; i &lt;list.size(); i++){
  
   Collections.swap(list. i, (i+1){
   System.out.println("The new list = " + list));
      }
    }
  }
  </code></pre>
  
  <p>I appreciate the help!!!</p>