The String is Immutable in Java because String objects are stored in the String pool. Since stored String literals are shared between various customers, there is consistently a hazard where one customer's activity would influence all another customer. Since reserving of String, objects were significant from execution reason this hazard was evaded by making String class Immutable.
Simultaneously, String was caused last so nobody can bargain invariant of String class, for example, Permanence, Caching, hashcode figuring, and so on by expanding and abrogating practices.