private static String stringOfChar(char ch,int len){
  StringBuffer buf=new StringBuffer();
  for (int i=0; i < len; i++) {
    buf.append(ch);
  }
  return buf.toString();
}

private static String stringOfChar ( char ch , int len ) { StringBuffer buf = new StringBuffer ( ) ; for ( int i = 0 ; i < len ; i ++ ) { buf . append ( ch ) ; } return buf . toString ( ) ; }
creates a string of a given length containing the given character
