Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道在c#中,指向子类对象的父类的引用变量会调用子类对象的重写方法和基类对象的隐藏方法。在运行时,基类引用变量会计算出对象的实际类型,因此它会调用被覆盖的版本。如果引用变量可以检查实际对象,那么为什么在隐藏方法的情况下它调用基类方法?