Q. Why are String objects in Java considered immutable?
Solution:
Immutability means that once a String object is created, its internal state (the sequence of characters) cannot be altered. Any operation that seems to modify a string actually creates a new String object.
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.