2 ms·
It's worth noting that this doesn't actually provide an immutable collection, it provides an immutable view of an existing one. If some other code has a referen
by lemming 17y ago
It's worth noting that this doesn't actually provide an immutable collection, it provides an immutable view of an existing one. If some other code has a reference to the underlying collection it can still be mutated. However this works well for the common case where you have a method which creates a local collection and returns the immutable view - in that case the collection is effectively immutable.