Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void doubleList(ArrayList<String> array) {
- // account for the added index = incrementing by 2
- for (int i = 0; i < array.size(); i+=2) {
- String word = array.get(i);
- array.add(i, word);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement