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
Maha
NA
0
328.6k
Hashtable
Sep 12 2013 7:35 AM
This program is given in the following website. Following output is expected because elements are in this order in Add() method. But vice versa output of this order is returned. Please explain the reason. Problem is coloured.
http://www.dotnetperls.com/dictionaryentry
1 = one
2 = two
3 = three
using System;
using System.Collections;
class Program
{
static void Main()
{
// Create hashtable with some keys and values.
Hashtable hashtable = new Hashtable();
hashtable.Add(
1, "one"
);
hashtable.Add(
2, "two
");
hashtable.Add(
3, "three"
);
// Enumerate the hashtable.
foreach (DictionaryEntry entry in hashtable)
{
Console.WriteLine("{0} = {1}", entry.Key, entry.Value);
}
Console.ReadKey();
}
}
/*
3 = three
2 = two
1 = one
*/
Reply
Answers (
5
)
save multiple
Can any one please tell me,how to implement back button