Question: Write a method public static String repeat(String str, int n) that returns the string str repeated n times. For example, repeat(ho, 3) returns hohoho.
Write a method public static String repeat(String str, int n) that returns the string str repeated n times. For example, repeat("ho", 3) returns "hohoho".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
