Sail E0 Webinar
Question
The correct code to access all the elements of the queue collection created using the C#.NET code snippets given below is?Queue q = new Queue();q.Enqueue("Harsh");q.Enqueue('a');q.Enqueue(false);q.Enqueue(70);q.Enqueue(8.5);
Options:
A .  IEnumerator e;e = q.GetEnumerator(); while(e.MoveNext()) Console.WriteLine(e.Current);
B .  IEnumerable e; e = q.GetEnumerator(); while(e.MoveNext())
C .  IEnumerable e e = q.GetEnumerable(); while(e.MoveNext()) Console.WriteLine(e.Current);
D .  All of the mentioned
Answer: Option A





Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers