static void Main(string[] args) { MyStack <int> myStack = new MyStack <int>(1); Console.WriteLine(myStack.PopItem()._value); MyStack <int> myStack2 = new MyStack <int>(1); myStack2.PushItem(2); myStack2.PushItem(3); foreach (var x in myStack2) { Console.WriteLine(x); } }
public MyStackEnumerator(MyStack <T> stack) { this.stack = stack; }