Tagged articles
string pool
13 articles · Page 1 of 1
This article explains how == compares primitive values and object references, why Object.equals() defaults to ==, how classes like String and Integer override equals(), the impact of the string constant pool, integer caching, auto‑boxing, floating‑point pitfalls, and best practices for correctly comparing objects in Java.
InterviewJavaReference Types
0 likes · 16 min read

This guide explains the fundamental distinction between Java's == operator and the equals() method, covering primitive vs. reference comparisons, default implementations, common pitfalls like string interning and Integer caching, and the essential contract with hashCode for reliable object equality.
InterviewOperatorequality
0 likes · 7 min read

This article explains how Java handles string literals and the new String() constructor, detailing when objects are created in the string constant pool versus the heap, and demonstrates the resulting reference comparisons with code examples.
JavaObject CreationString
0 likes · 3 min read

This article explains why Java's String class is immutable, detailing the benefits such as thread safety, cached hash codes, and string pooling, and describes the internal mechanisms—including a private final char array, creation of new objects on concatenation, and the intern method—that enforce this immutability.
ConcurrencyJavaString
0 likes · 5 min read

This article explains how Java's compiler optimizes string concatenation through constant folding, the rules that define compile‑time constants, and why only a single String object is created in many seemingly multiple‑object scenarios.
Compile-time ConstantJVMJava
0 likes · 11 min read

This article explains why Java strings are immutable, how the JVM uses the string constant pool and the final keyword to manage memory, and demonstrates the behavior with code examples that show reference handling, object creation, and common string operations.
FinalJVMJava
0 likes · 11 min read

This article explores the purpose and inner workings of Java's String.intern method, detailing how it interacts with the string constant pool across JDK versions, illustrating memory layout differences, code examples, and practical guidelines for when to apply intern for performance gains.
JDKJavaString.intern
0 likes · 12 min read

This article explains how Java's String.intern method interacts with the string constant pool, detailing the differences between JDK6, JDK7, and JDK8 implementations, and walks through multiple code examples that show why strings that were originally unequal become identical after interning.
InternJVMJava
0 likes · 12 min read

This article explains the functions and storage locations of Java's runtime constant pool, string constant pool, and static constant pool across different JDK versions, illustrating JVM memory layout, constant pool structures, and how they evolve from PermGen to Metaspace.
JDKJVMJava
0 likes · 9 min read

This article explains how Java's String class encapsulates character arrays, the role of the string pool, the effects of the new operator, the intern() method, and the proper use of == versus equals() for reliable string comparison and memory optimization.
InternObject ComparisonString
0 likes · 8 min read

A sudden surge of requests triggers e.printStackTrace() to flood the JVM's non‑heap string pool, exhausting memory, blocking threads, and causing the entire Java web service to become unresponsive, highlighting the dangers of careless exception logging.
Exception HandlingJavaMemory Leak
0 likes · 5 min read

This article explains Java's runtime memory regions, including the program counter, stacks, heap, method area, constant pool, and direct memory, and details the HotSpot object creation process, memory layout, access mechanisms, as well as String and wrapper class behaviors, providing essential knowledge for Java interview preparation.
Interview PreparationJVMJava
0 likes · 19 min read

This article explains how Alibaba's Sophix hot‑fix framework trims Android resource patches by analyzing and reconstructing the resources.arsc string pools, removing unused entries, and re‑indexing references, achieving dramatic size reductions while preserving runtime performance.
AndroidHotfixResource Optimization
0 likes · 14 min read
