Write a method public static String repeat(String str, int n) that returns the string str repeated n

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".

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: