Folder icon

Tags / dig deeper

Using StringBuilder instead of usual concatenation. When is it appropriate?


Uncaught exception: the image is currently being shown in a museum

You might know that using string concatenation in Java is not a good practice as it might affect performance. In this short article, I will try to describe when it is necessary to use StringBuilder and when we can afford using concatenation (+ sign). Let's start with a simple example: To see how it works under the hood…
Posted on