Tagged articles
StringBuffer
16 articles · Page 1 of 1
This article explains Java String immutability, the hidden object creation behind '+' concatenation across JDK versions, StringBuilder and StringBuffer internals, constant pool behavior, and the invokedynamic optimization in JDK 9+, with bytecode examples and performance best practices.
Constant PoolJVMJava
0 likes · 16 min read

This article thoroughly examines Java's String, StringBuffer, and StringBuilder, explaining their internal implementations, immutability, JDK 9 changes, performance characteristics, and best‑practice usage scenarios, while providing concrete code examples, benchmarks, and interview questions to help developers choose the right tool.
InterviewJavaMemory
0 likes · 21 min read

This article explains the immutability of Java's String, compares the mutable StringBuilder and thread‑safe StringBuffer, provides performance benchmarks, and offers practical guidance on selecting the appropriate class for different coding scenarios, especially for interview preparation.
StringStringBufferStringBuilder
0 likes · 7 min read

This article breaks down the interview focus on Java's String, StringBuilder, and StringBuffer, explaining their mutability, thread‑safety, performance trade‑offs, core APIs, and best‑practice scenarios, while providing code examples and a concise comparison table for developers.
InterviewStringStringBuffer
0 likes · 9 min read

The article dissects a JD interview question about concatenating one hundred million strings, comparing String, StringBuilder, and StringBuffer, and explains how immutability leads to object explosion, how StringBuilder’s default capacity causes costly expansions, and why StringBuffer’s synchronized methods become a performance bottleneck in high‑concurrency scenarios.
ConcurrencyGCString
0 likes · 44 min read

This article explains the fundamental differences between Java's String, StringBuilder, and StringBuffer—covering immutability, thread‑safety, internal caching mechanisms, and performance characteristics—while providing concrete code examples that illustrate how each class behaves in single‑threaded and multi‑threaded scenarios.
JavaStringStringBuffer
0 likes · 6 min read

This article dissects three high-frequency Java/SpringBoot interview questions—String vs StringBuffer vs StringBuilder, @SpringBootApplication annotation internals, and @Component with @Autowired for MyBatis Mapper—revealing underlying mechanisms, performance trade-offs, common pitfalls, and correct usage patterns to deepen technical understanding beyond rote memorization.
@Autowired@Component@SpringBootApplication
0 likes · 10 min read

Java 21 introduces repeat() overloads for StringBuilder and StringBuffer, allowing you to duplicate characters or CharSequence efficiently; the article demonstrates usage with sample code, explains the Unicode codePoint variant, and invites readers to explore creative applications of this new API.
Code ExampleJavaJava 21
0 likes · 2 min read

This article examines Java's String immutability, detailing how the final character array and private design prevent modification, compares mutable alternatives like StringBuilder and StringBuffer, and discusses their thread safety and performance implications to guide developers in choosing the appropriate class for different scenarios.
JavaStringStringBuffer
0 likes · 5 min read

This article compares five Java string‑concatenation techniques—‘+’, String.concat(), StringUtils.join(), StringBuffer.append() and StringBuilder.append()—through extensive timing tests from 100 to 900 000 iterations, revealing their speed, memory usage and best use cases for large‑scale data processing.
Apache CommonsJavaString Concatenation
0 likes · 11 min read

This article explains why StringBuilder is not thread‑safe, demonstrates the problem with a multithreaded example that produces a wrong length and occasional ArrayIndexOutOfBoundsException, and shows how StringBuffer’s synchronized implementation avoids these issues.
ConcurrencyJavaStringBuffer
0 likes · 8 min read

This article explains the thread‑safety differences between StringBuilder and StringBuffer, demonstrates the problems of using mutable shared objects in multithreaded Java code, presents three solutions, and discusses why Servlets are not thread‑safe by default, highlighting visibility and ordering concepts.
ConcurrencyJavaServlet
0 likes · 10 min read

This article explains the internal implementation of Java's StringBuilder and StringBuffer, demonstrates how concurrent appends cause incorrect lengths and occasional ArrayIndexOutOfBoundsException, and shows why StringBuffer remains thread‑safe by using synchronized methods.
ConcurrencyJavaStringBuffer
0 likes · 7 min read

This article explains the immutable nature of Java's String class, compares it with mutable StringBuilder and thread‑safe StringBuffer, shows how the JVM handles string literals, constant pool, intern(), and provides performance guidelines and code examples for efficient string manipulation.
StringStringBufferStringBuilder
0 likes · 16 min read

The article explains why StringBuilder is not thread‑safe, analyzes its internal implementation and the non‑atomic count update that leads to incorrect lengths and occasional ArrayIndexOutOfBoundsException, and shows that using synchronized StringBuffer avoids these issues.
Java ConcurrencyStringBufferbackend development
0 likes · 7 min read

This article explains the internal implementation of Java's String class, compares it with StringBuilder and StringBuffer, demonstrates performance differences through benchmark code, and provides common interview questions with detailed answers, helping developers choose the appropriate class for various scenarios.
InterviewJavaMemory
0 likes · 16 min read
