TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tommy Sin
NA
19
104.4k
Question about "readonly"
Mar 25 2011 10:08 AM
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);
}
}
Reply
Answers (
5
)
How can I delete autocomplete history of internet explorer using c#.
datatable to database