4 ms·
That example with arrays only works if you treat the array as immutable. Otherwise you get an exception.
by Tyr42 6y ago
That example with arrays only works if you treat the array as immutable.
Otherwise you get an exception.
- toolslive 6y agoString[] strings = {"x0","x1"}; strings[0] = "something else"; // mutable. Object[] things = strings; things[1] = null;// mutable. all works.(in java), but I understand what you mean.