What does it mean to say that a Java String is immutable?
Correct answer A. Its character sequence cannot change after creation
Explanation
Once a String object exists, its contents are fixed, and methods such as replace or toUpperCase return a new String instead of altering the original. The variable holding it can still be reassigned to a different object unless it is final. Immutability makes strings safe to share between threads and suitable as hash keys.
Answer checked How we write and check questions
Discussion