using System.Collections;
using System.Collections.Generic;
public static void Main()
var customStack = new CustomStack();
customStack.Push("Hello World");
public class CustomStack : Stack
public override void Push(object obj)
Console.WriteLine($"My custom magic for push, on the object {obj}");
public override object Pop()
Console.WriteLine($"My custom magic for pop, on the object {obj}");