imsavva.com

Folder icon

Tags / dig deeper

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

showPostImage(1943353928)

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
2017-12-21