Tagged articles
1 articles
Page 1 of 1
Java Captain
Java Captain
Nov 29, 2017 · Fundamentals

What Is an Immutable Object in Java? Understanding String Immutability

This article explains the concept of immutable objects in Java, using String as a case study, clarifies the difference between object references and objects, examines String’s internal fields across JDK versions, demonstrates how typical mutating methods actually create new instances, and shows how reflection can bypass immutability.

Immutable ObjectReflectionString
0 likes · 9 min read
What Is an Immutable Object in Java? Understanding String Immutability