Tagged articles
13 articles
Page 1 of 1
Tech Freedom Circle
Tech Freedom Circle
Jan 4, 2026 · Backend Development

Choosing Between String, StringBuilder, and StringBuffer for Concatenating 100 Million Strings in a JD Interview

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.

Stringconcurrencygc
0 likes · 44 min read
Choosing Between String, StringBuilder, and StringBuffer for Concatenating 100 Million Strings in a JD Interview
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Dec 22, 2025 · Fundamentals

Why Is StringBuilder Faster Than StringBuffer? Understanding Java’s Mutable vs Immutable Strings

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
Why Is StringBuilder Faster Than StringBuffer? Understanding Java’s Mutable vs Immutable Strings
Programmer DD
Programmer DD
Sep 25, 2023 · Backend Development

Discover Java 21’s New repeat() Method for StringBuilder and StringBuffer

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
Discover Java 21’s New repeat() Method for StringBuilder and StringBuffer
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Aug 3, 2022 · Fundamentals

Why Is Java String Immutable? Understanding Final, Thread Safety, and Performance

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.

JavaStringimmutability
0 likes · 5 min read
Why Is Java String Immutable? Understanding Final, Thread Safety, and Performance
Programmer DD
Programmer DD
Oct 26, 2021 · Backend Development

Which Java String Concatenation Method Is Fastest? A Performance Comparison

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
Which Java String Concatenation Method Is Fastest? A Performance Comparison
Selected Java Interview Questions
Selected Java Interview Questions
Apr 5, 2021 · Backend Development

Understanding Thread Safety in Java: StringBuilder, StringBuffer, and Servlets

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.

Backend DevelopmentJavaServlet
0 likes · 10 min read
Understanding Thread Safety in Java: StringBuilder, StringBuffer, and Servlets
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jun 13, 2020 · Fundamentals

Understanding Java String, StringBuilder, and StringBuffer

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.

Stringimmutabilitystringbuffer
0 likes · 16 min read
Understanding Java String, StringBuilder, and StringBuffer
Java Captain
Java Captain
Mar 2, 2018 · Fundamentals

Understanding Java String, StringBuilder, and StringBuffer: Differences, Performance, and Interview Questions

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.

JavaMemoryString
0 likes · 16 min read
Understanding Java String, StringBuilder, and StringBuffer: Differences, Performance, and Interview Questions