I have some code like this:
StringBuilder rgba = new StringBuilder();
for (...){
....
rgba.append(value + ", ");
}
IntelliJ
shows me the following warning:
string concatenation as argument to 'stringbuilder.append()' call
From here, here and other sources I understand that concatenation is actually creates a new String object and that negates the whole point of using a StringBuilder
.
So IntelliJ
suggests me to use
rgba.append(value);
rgba.append(", ");
instead of
rgba.append(value + ", ");
But will this really be better?
Will this code be clearer?
Will this make the execution faster?