I was reading about how when possible the java compiler will compile strings concatenated with the \"+\" operator into instances of StringBuilder, and how this makes it bett
Try to place StringBuilder toBuild = new StringBuilder() above the loop. The same with String toPrint and do += for string and you will see the difference.
Don't create new String and StringBuilder in the loop.