Multiple Choice
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) ;
A) IEnumerator e; e = q.GetEnumerator() ; while (e.MoveNext() ) Console.WriteLine(e.Current) ;
B) IEnumerable e; e = q.GetEnumerator() ; while (e.MoveNext() ) Console.WriteLine(e.Current) ;
C) IEnumerator e; e = q.GetEnumerable() ; while (e.MoveNext() ) Console.WriteLine(e.Current) ;
D) IEnumerator e; e = Queue.GetEnumerator() ; while (e.MoveNext() ) Console.WriteLine(e.Current) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q1: Which of the following statements is correct
Q3: The point at which an exception is
Q4: Which of the following can be facilitated
Q5: The scope of a variable depends on
Q6: _ is a set of devices through
Q7: The controls available in the tool box
Q8: A class implements two interfaces each containing
Q9: Which of the following statements is correct
Q10: Which of the following statements is correct
Q11: The reason that C# does not support