logo CodeStepByStep logo

addStars

Language/Type: Java ArrayList collections
Related Links:

Write a method named addStars that accepts as a parameter an ArrayList of strings, and modifies the list by placing a "*" element between elements, as well as at the start and end of the list. For example, if a list named list contains {"the", "quick", "brown", "fox"}, the call of addStars(list); should modify it to store {"*", "the", "*", "quick", "*", "brown", "*", "fox", "*"}.

Method: Write a Java method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.