Mid Collections

How would you clear a Queue<T>?

Use the Clear() method to remove all elements.

Example:

tasks.Clear();

After calling Clear(), the queue is empty (Count == 0).

Follow:

More from C# Programming Tutorial

All questions for this course