Construction of the string "xxxyyyzzz", using variables and assignments:
String x = "xxx", y = "yyy", z = "zzz"; String temp = x.concat(y); String result = temp.concat(z); System.out.println(result);
We use one variable for each object and for each intermediate result.