1. Thread Safety (No problem with this)
2. Performance
I am not understanding how does immutable feature of String helps in getting better performance.When everytime a String is modified a new String Object is created and if we do these modifications many times , then more and more String objects will be created in the memory(or more specifically heap).
Then how does this improve memory efficiency or performance?