Why can we change the unmodifiable list if we have the original one?
问题 By looking at the code of Collections class, i got to know that when we are using the method unmodifiableList(List list) or unmodifiableCollection(Collection c) it is not creating a new object but it is returning the reference of the same object and overriding the methods which can modify the List [ add , addall , remove , retainAll ... ] So i ran this test: List modifiableList = new ArrayList(); modifiableList.add ( 1 ); List unmodifiableList = Collections.unmodifiableList( modifiableList );