![]() Gets a value indicating whether access to the Stack is synchronized (thread safe). ![]() Gets the number of elements contained in the Stack. Initializes a new instance of the Stack class that is empty and has the specified initial capacity or the default initial capacity, whichever is greater. Initializes a new instance of the Stack class that contains elements copied from the specified collection and has the same initial capacity as the number of elements copied. Initializes a new instance of the Stack class that is empty and has the default initial capacity. Stack accepts null as a valid value and allows duplicate elements. If the capacity needs to be increased to accommodate the new element, Push becomes an O(n) operation, where n is Count. If Count is less than the capacity of the stack, Push is an O(1) operation. For more information, see Non-generic collections shouldn't be used on GitHub. Instead, we recommend that you use the generic class. We don't recommend that you use the Stack class for new development. As elements are added to a Stack, the capacity is automatically increased as required through reallocation. The capacity of a Stack is the number of elements the Stack can hold. ' This code produces the following output. Public Shared Sub PrintValues(m圜ollection As IEnumerable) Displays the properties and values of the Stack.Ĭonsole::WriteLine( "\tCount: ", myStack.Count)Ĭonsole.Write(ControlChars.Tab
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |