Removes and returns the object at the top of the Stack.
This method is similar to the Stack.Peek method, but Stack.Peek does not modify the Stack.
null can be pushed onto the Stack as a placeholder, if needed. To distinguish between a null value and the end of the stack, check the Stack.Count property or catch the InvalidOperationException, which is thrown when the Stack is empty.
Stack is implemented as a circular buffer. This method is an O(1) operation.