Tagged articles

Equals vs ==

6 articles · Page 1 of 1
CodeNotes
CodeNotes
Jun 7, 2026 · Fundamentals

Mastering Java Strings: When to Use equals vs == and Common Pitfalls

Java's String class is immutable and stored in a constant pool; the article explains the difference between == and equals, demonstrates common methods for inspection, transformation, splitting, and conversion, and shows best practices for concatenation with StringBuilder, thread‑safe StringBuffer, and newer utilities like join, repeat, format, and text blocks.

Equals vs ==JavaJava 8
0 likes · 10 min read
Mastering Java Strings: When to Use equals vs == and Common Pitfalls