Write code to create String
//package com.book2s; public class Main { public static void main(String[] argv) { char ch = 'a'; int count = 42; System.out.println(createString(ch, count)); }/*from w w w .ja v a2 s .c o m*/ public static String createString(char ch, int count) { StringBuilder result = new StringBuilder(count); for (int index = 0; index < count; index++) { result.append(ch); } return result.toString(); } }