C# Programming - Collection Classes - Discussion

Discussion Forum : Collection Classes - General Questions (Q.No. 9)
9.
Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below?
Queue q = new Queue(); 
q.Enqueue("Sachin"); 
q.Enqueue('A'); 
q.Enqueue(false); 
q.Enqueue(38); 
q.Enqueue(5.4);
IEnumerator e;
e = q.GetEnumerator(); 
while (e.MoveNext())
Console.WriteLine(e.Current);
IEnumerable e;
e = q.GetEnumerator(); 
while (e.MoveNext()) 
Console.WriteLine(e.Current);
IEnumerator e;
e = q.GetEnumerable(); 
while (e.MoveNext()) 
Console.WriteLine(e.Current);
IEnumerator e;
e = Queue.GetEnumerator(); 
while (e.MoveNext()) 
Console.WriteLine(e.Current);
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.