pop method
Removes and returns the top element from the stack. Throws a StateError if the stack is empty.
Implementation
T pop() {
if (empty) {
throw StateError('Cannot pop from an empty Stack');
}
return _container.deleteLast();
}
Removes and returns the top element from the stack. Throws a StateError if the stack is empty.
T pop() {
if (empty) {
throw StateError('Cannot pop from an empty Stack');
}
return _container.deleteLast();
}