Advertisement
Guest User

Untitled

a guest
May 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public static void doubleList(ArrayList<String> array) {
  2.     // account for the added index = incrementing by 2   
  3.     for (int i = 0; i < array.size(); i+=2) {
  4.         String word = array.get(i);
  5.         array.add(i, word);       
  6.     }   
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement