VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/queue-count-property-in-c-sharp/

⇱ Queue.Count Property in C# - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Queue.Count Property in C#

Last Updated : 11 Jul, 2025
This property is used to get the number of elements contained in the Queue. Retrieving the value of this property is an O(1) operation and it comes under the System.Collections namespace. Syntax:
public virtual int Count { get; }
Property Value: This property returns the number of elements contained in the Queue. Below programs illustrate the use of the above-discussed property: Example 1:
Output:
Total number of elements in the Queue are : 0
Example 2:
Output:
Total number of elements in the Queue are : 6
Reference:
Comment

Explore