Question: 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?
Options
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);
Collection Classes - General Questions more questions
In which of the following collections is the Input/Output index-based?
In which of the following collections is the Input/Output based....
In a HashTable Key cannot be null, but Value can....
Which of the following statements are correct about the Stack....
A HashTable t maintains a collection of names of states....
Which of the following is NOT an interface declared in....
Suppose value of the Capacity property of ArrayList Collection is....
Which of the following is an ordered collection class?
Which of the following is the correct way to find....
Which of the following statements are correct about a HashTable....
Attributes - General Questions more Online Exam Quiz
Attributes - General Questions
Classes and Objects - General Questions
Constructors - General Questions