By looking at the code of Collections class, i got to know that when we are using the method unmodifiableList(List list)
or unmodifiableCollection(Coll
Now the point is why it is referring to the same object? Why it don't create a new object?
Performance. It just doesn't scale to make a full copy. It would be a linear time operation to make a full copy which obviously isn't practical. Also, as others already noted, the point is that you can pass the reference of the unmodifiable list around without having to worry that it gets changed. This is very helpful for multithreaded programs.