public static void Main(String[] args) { Stack s = new Stack(); s.Push(1); Console.WriteLine("Size of Stack: " + s.Size() + "\tTop : " + s.Top()); s.Push(7); Console.WriteLine("Size of Stack: " + s.Size() + "\tTop : " + s.Top()); s.Push(9); Console.WriteLine("Size of Stack: " + s.Size() + "\tTop : " + s.Top()); s.Pop(); Console.WriteLine("Size of Stack: " + s.Size() + "\tTop : " + s.Top()); s.Pop(); Console.WriteLine("Size of Stack: " + s.Size() + "\tTop : " + s.Top()); s.Push(5); Console.WriteLine("Size of Stack: " + s.Size() + "\tTop : " + s.Top()); /* * Output : * * current size: 4 * 4 * 3 * 2 * current size: 2 */ }