The correct code to access all the elements of the queue collection created using the following C#.NET code snippets? [code] Queue q =

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

Tìm kiếm

Back
Top