In this lecture, we’ll go over why string concatenation via
+ and especially
+= inside loops leads to creating lots of unnecessary strings, and how
StringBuilder helps you efficiently build long (including multi-line) text. In practice, we’ll look at
append(),
appendLine(),
toString(), as well as typical scenarios: a task report, help text, and a unified error format.