Tagged articles
6 articles
Page 1 of 1
Architect's Guide
Architect's Guide
Jun 27, 2023 · Backend Development

Understanding Java String Concatenation, StringBuilder, and Object Creation with javap Analysis

The article explains why using the '+' operator for string concatenation in Java creates many temporary objects, how the StringBuilder class and compile‑time optimizations can avoid this overhead, and demonstrates object‑creation counts for two typical interview questions using javap bytecode inspection.

JavaJavapMemory Optimization
0 likes · 10 min read
Understanding Java String Concatenation, StringBuilder, and Object Creation with javap Analysis
Architect's Tech Stack
Architect's Tech Stack
Nov 27, 2020 · Backend Development

When Does Java Use StringBuilder for String Concatenation?

This article investigates Java's string concatenation behavior, demonstrating through two examples why some concatenations invoke StringBuilder while others are optimized by the compiler, and explains the underlying bytecode differences revealed by decompiling with javap.

Compiler OptimizationJavaJavap
0 likes · 3 min read
When Does Java Use StringBuilder for String Concatenation?
Programmer DD
Programmer DD
Jan 22, 2019 · Backend Development

Why Your Java String Concatenation Is Slowing Down and How to Fix It

This article examines how different Java string concatenation techniques impact performance, demonstrates compile‑time optimizations and bytecode generation, and provides practical recommendations—such as using StringBuilder—to avoid costly object creation inside loops.

JDKJavaJavap
0 likes · 8 min read
Why Your Java String Concatenation Is Slowing Down and How to Fix It