String is immutable so it can be safely shared between threads, cached/interned in the String pool, and reliably used as a key in hash‑based collections (stable hashCode). It also improves security because values like class names or file paths can’t be modified after creation.