title: Error: bad operand types for binary operator '+'
body: <p>I have here a code that would take a String called <code>toRepeat</code> and repeat it in the same line by n number of times. For example toRepeat = *, n= 3, result = ***</p>
  
  <pre><code>public class RepeatIt {
      public static String repeatString(final Object toRepeat, final int n) {
          int i = 0;
          if (toRepeat instanceof String) {
              while (i &lt; n) {
                  toRepeat = toRepeat + toRepeat;
              }
              return toRepeat;
          } else {
              return "Not a string";
          }
      }
  }
  </code></pre>
  
  <p>However I get an Error on the <code>+</code> sign between the 2 <code>toRepeat</code> which states bad operand types for binary operator <code>+</code>. If you know how I could fix this please tell me I would much appreciate it.</p>