How many memory locations will it take to have a string concatenation?
String myStringVariable = "Hello";
In following two statements :
String s = "ABC" + "Hello" + "DEF";
and
String s = "ABC";
s = s + "Hello";
s = s + "DEF";
and
String s = "ABC" + myStringVariable + "DEF";
Which will consume more memory? In which of the case StringBuilder is useful to the most?