Originally Posted by KeZZeR
Would this means that arrays are immutable?
I think immutable means that you cannot change them. But how can this be so if you can do this:
int foo = new Array(5);
foo = 3;
foo = 69;
foo = 7;
You've changed the value of an element in the array. So Java arrays are mutable.
Strings in Java, however, are immutable. You can't change a character in a String without creating a new String -- but then you haven't changed a character in the original String, so you haven't mutated it. So String are immutable.
Hope that helps,