String builder vs string concatenation [duplicate]
In your particular example, none because the compiler internally uses StringBuilders to do String concatenation. If the concatenation occurred in a loop, however, the compiler could create several StringBuilder and String objects. For example: String s= “” ; for(int i= 0 ; i < 10 ; i++ ) s+= “a” ; Each time line 3 … Read more