Write a method called stutter that accepts 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?”], after the call it should store
[“how”, “how”, “are”, “are”, “you?”, “you?”].
public static void stutter(ArrayList strList)
{
for(int i = 0; i < strList.size(); i += 2)
{
String str = strList.get(i);
strList.add(i + 1, str);
}
}