The Correct Code To Access All The Elements Of The Queue #699
The correct code to access all the elements of the queue collection created using the following C#.NET code snippets?</p> <pre><code class="language-csharp" line="1"> Queue q = new Queue(); q.Enqueue("Harsh"); q.Enqueue('a'); q.Enqueue(false); q.Enqueue(70); q.Enqueue(8.5); </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Reflections, Multithreaded Programming, Collection Classes and Mathematical Functions - Collection Classes - Quiz No.1.
The correct code to access all the elements of the queue collection created using the following C#.NET code snippets?
Queue q = new Queue(); q.Enqueue("Harsh"); q.Enqueue('a'); q.Enqueue(false); q.Enqueue(70); q.Enqueue(8.5);
IEnumerator e; e = q.GetEnumerator(); while(e.MoveNext()) Console.WriteLine(e.Current);
IEnumerable e; e = q.GetEnumerator(); while(e.MoveNext())
IEnumerable e e = q.GetEnumerable(); while(e.MoveNext()) Console.WriteLine(e.Current);
All of the mentioned