Domanda di colloquio di Nexient

What is the difference between string concatenation and string builder?

Risposta di colloquio

Anonimo

21 ott 2016

String Concatenation operates on O(n^str.length) as we concatinate a string every iteration will take the previously written string rewrite it and append the new character each time. whereas string builder operates in O(n) as it only appends on letter at the time to what it has.