Count Property
Collapse the table of content
Expand the table of content

Queue.Count Property

Gets the number of elements contained in the Queue.

[Visual Basic]
Public Overridable ReadOnly Property Count As Integer  Implements _
   ICollection.Count
[C#]
public virtual int Count {get;}
[C++]
public: __property virtual int get_Count();
[JScript]
public function get Count() : int;

Property Value

The number of elements contained in the Queue.

Implements

ICollection.Count

Remarks

Count is the number of elements that are actually in the Queue. The capacity of a Queue is the number of elements that the Queue is capable of storing.

Count is always less than or equal to the capacity of the Queue. If Count exceeds the capacity of the Queue while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new element. The new capacity is determined by multiplying the current capacity by the growth factor, which is determined when the Queue is constructed.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Queue Class | Queue Members | System.Collections Namespace

Show:
© 2016 Microsoft