You've missed a semi colon on the line you're having trouble with, it should be return "";
and not return ""
Also, the line System.out.println(repeat (str));
should have 2 arguments because you're repeat definition is:
public static String repeat(String str, int n)
As a further note, an easier function might be
public static String repeat(String str, int n) { if (n == 0) return ""; String return_str = ""; for (int i = 0; i < n; i++) { return_str += str; } return return_str; }