Question: Write a method that accepts two ArrayLists of Strings as a parameter and returns a new ArrayList that contains a merge of the original two.

 Write a method that accepts two ArrayLists of Strings as a

Write a method that accepts two ArrayLists of Strings as a parameter and returns a new ArrayList that contains a merge of the original two. In the merged list, you alternate strings from each list until you run ou of strings in one of the two lists. For example, if the first array list contains the Strings "a", "b", "c", " d ", and "en in that order and the second contains the strings " f " and " g ", your method should return the an ArrayList with the strings "a", "f", "b", "g in that order

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!