The (unexpected) output is:
Here's the code, which can speak for itself, I think.
I think I see that because "this.chest = chest;" is really "this.chest = new
String(chest);", it means that my reference that's in the array is pointing to an old copy. Fine. Weird, but fine. Now, how does one deal with it? I thought of:
But that's not very nice now, is it?
This is one of those "there must be a better way" things (without removing the key concept here: the array of attributes). They all might not be String objects, by the way.
--Dale--