SPIRO THE TECH GURU

Back

Why String is immutable in Java ?

By Admin on

String is an immutable class in Java. An immutable class is simply a class whose instances cannot be modified. All information in an instance is initialized when the instance is created and the information can not be modified. There are many advantages of immutable classes. This article summarizes why String is designed to be immutable. A good answer depends on the deep understanding of memory, synchronization, data structures, etc.



SPIRO Google Plus