Question
Queue q = new Queue();
q.Enqueue("Harsh");
q.Enqueue('a');
q.Enqueue(false);
q.Enqueue(70);
q.Enqueue(8.5);
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
Posted under C# programming
e = q.GetEnumerator();
while(e.MoveNext())
Console.WriteLine(e.Current);
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. The correct code to access all the elements of the queue collection created using the C#.NET code snippets given below is?
Similar Questions
Discover Related MCQs
Q. Which statements among the following are correct about the Collection Classes available in Framework Class Library?
View solution
Q. Among the given collections which one is I/O index based?
View solution
Q. Which among the given statements are correct about the Stack collection?
View solution
Q. A HashTable t maintains a collection of names of states and capital city of each state.Which among the following finds out whether “New delhi” state is present in the collection or not?
View solution
Q. In which of the following collections is the I/O based on a key?
View solution
Q. The wrong statements about a HashTable collection are?
View solution
Q. Which of these classes contains only floating point functions?
View solution
Q. What is the value of double constant ‘E’ defined in Math class?
View solution
Q. Which among the given classes provides types of rounding functions?
View solution
Q. Which of these methods is a rounding function of Math class?
View solution
Q. Which of these method returns a smallest whole number greater than or equal to variable X?
View solution
Q. Which of these methods return a largest whole number less than or equal to variable X?
View solution
Q. Which of the following functions return absolute value of a variable?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!