public static String repeatString(String pattern,int repeats){
  StringBuilder buffer=new StringBuilder(pattern.length() * repeats);
  for (int i=0; i < repeats; i++) {
    buffer.append(pattern);
  }
  return new String(buffer);
}

public static String repeatString ( String pattern , int repeats ) { StringBuilder buffer = new StringBuilder ( pattern . length ( ) * repeats ) ; for ( int i = 0 ; i < repeats ; i ++ ) { buffer . append ( pattern ) ; } return new String ( buffer ) ; }
returns a string made up of repetitions of the specified string .
