 <p>Ok, I see you need it's recursive.</p> <pre><code>public static String repeater(int x, String word) { if (x == 0) { return ""; } else { return word.charAt(0) + repeater(x - 1, word); } } </code></pre> <p>How is this?</p> <p>For understanding this recursion, it is working like nested parentheses of Mathematics.</p> <pre><code>"H" + ("H" + ("H" + ("H" + ("H" + ("H" + ("")))))) </code></pre>