Question about "readonly"
Hello,
I am just wondering how I could add elements to the Dictionary below even if it is declared as readonly.
Are we not supposed to be able to modify the dictionary if it is declared as readonly?
Thanks.
class program
{
private static readonly Dictionary<string, int> _dictionary = new Dictionary<string, int>();
static void Main(string[] args)
{
_dictionary.Add("a",1);
_dictionary.Add("b",2);
_dictionary.Add("c",3);
}
}