he will not do anything; obj is a reference to an object (if the collection has a reference type), and not the object itself.
If the collection is of a primitive type, then obj will be a copy of the value in the collection, and, again, this means that the collection will not change.
Edit:
to replace an object, it depends on the type of your collection.
If it is IEnumerable<T> , then it is not changed, and you cannot change it.
The best option you have is to create a new collection and change it, for example so-
T [] array = myCollection.ToArray(); array[index] = newObject;
source share