Java Practice It | Exercise 10.4: doubleList | ArrayList, collections, array list

Опубликовано: 19 Октябрь 2024
на канале: Computer Engineering life
499
4

More practice its:
   • Java | Practice-It | Self Check & Exe...  



Problem:
https://practiceit.cs.washington.edu/...



Question:
Write a method doubleList that takes an ArrayList of Strings as a parameter and that replaces every string with two of that string. For example, if the list stores the values {"how", "are", "you?"} before the method is called, it should store the values {"how", "how", "are", "are", "you?", "you?"} after the method finishes executing.