Question: in java pleas, MUST USE RECURSION TO SOLVE public String dupEachChar (ArrayList str) This method takes an ArrayList of characters and returns a string that

in java pleas, MUST USE RECURSION TO SOLVE public String dupEachChar (ArrayListin java pleas, MUST USE RECURSION TO SOLVE

public String dupEachChar (ArrayList str) This method takes an ArrayList of characters and returns a string that consists of two of each of the characters-in the ArrayList. In addition, these duplicates are added to the ArrayList. If the ArrayList is empty, an empty string is returned and no characters are added to the ArrayList. Example (note the 'and " below are used to denote contents and are not part of the data) If an ArrayList containing 'a','b', and 'c' is passed to the method, the method would return "aabbcc" back as a String. In addition, the ArrayList would now have 6 elements instead of 3 matching the characters in the return string and in the same 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!