IReadOnlyCollection Interface Usage

This short program shows how read-only collections can be used. There have been times where I’ve wanted to expose the elements of a collection without giving the ability to change any elements. Just view them. From there if the collection needs to be modified it will have to be cast as another variable.

Granted it’s that way in most cases. I was messing around and was taught a way to modify the collection by way of casting an array object. I’ll demonstrate in the code.

Continue reading

Advertisements