我有以下代码:
public partial class Root : ICustomInterface
{
    public virtual void Display()
    {
        Console.WriteLine("Root");
        Console.ReadLine();
    }
}
public class Child : Root
{
    public override void Display()
    {
        Console.WriteLine("Child");
        Console.ReadLine();
    }
}
class Program
{
    static void Main(string[] args)
    {
        Root temp;
        temp = new Root();
        temp.Display();
    }
}
Output: "Root"
Desired output: "Child"
当我实例化一个Root对象并调用Display()我想要显示被覆盖的方法的方法时,Child这是否可能。
我需要这个,因为我必须创建一个插件,它是基本代码的扩展,并且Display()使类的方法无效Root并且只实现插件的方法Child