For the following code, how would I use concatenation instead of StringBuilder to create the string in the following method? My teacher said to use concatenation and not StringBuilder.
private static String readAll(Reader rd) throws IOException {
StringBuilder sb = new StringBuilder();
int cp;
while ((cp = rd.read()) != -1) {
sb.append((char) cp);
}
return sb.toString();
}