public static String repeatCharacter(char c,int repetitions){
  StringBuilder s=new StringBuilder(repetitions);
  for (int i=0; i < repetitions; i++) {
    s.append(c);
  }
  return s.toString();
}

public static String repeatCharacter ( char c , int repetitions ) { StringBuilder s = new StringBuilder ( repetitions ) ; for ( int i = 0 ; i < repetitions ; i ++ ) { s . append ( c ) ; } return s . toString ( ) ; }
forms a string by repeating the character the given number of times .
