Java String values not matching text after substring?

Since String objects are immutable, the compiler is free to share the underlying data. When you do a substring() you create a new String reference object that points to the original string array but has a different starting offset and length.

Your problem has nothing to do with immutability: If you have a collection/array of objects, changing the value of a local variable that holds a reference to on of the objects has no effect on the collection/array.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions