Java allows us to concatenate Strings in Java using just the '+' operator
String str = "a" + "b" + "c";
It's a simple way to do the job, and much less verbose than using StringBuilder.
But in cases of Loops like the one below, which approach is the most performative?
'+' or StringBuilder?
public static void main(String... args) {
long initialTime = System.currentTimeMillis();
String s = "a";
for (int i = 0; i < 100000; i++) {
s += "a";
}
System.out.println("Total time: " + (System.currentTimeMillis() - initialTime));
}