I hope below comments make every one in commendable position to answer " Why String is immutable".
Look at this example: We have a file open method with login check. We pass a String to this method to process authentication which is necessary before the call will be passed to OS. If String was mutable it was possible somehow to modify its content after the authentication check before OS gets request from program then it...
Leave a comment: