String Multiplier

Write a static method that receives a String and an integer. It should return a String consisting of the given number of copies concatenated.

For example, if "cat" and 4 are passed in, your method should return the String "catcatcatcat".

Either a for loop or while loop will be accepted.

Preconditions:

Examples:

Files Needed




©2003–2016 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License