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.
如果我有一个带有“virtual void Method()=0”的 AbstractClass。如果 DerivedClass 将实现定义为 "virtual void Method() { }" 或简单地 "void Method() { }" 有什么区别?
没有区别。这只是为了清楚。
任何在基类中定义为虚拟的方法,在从它继承的类中也是虚拟的,无论它是否被这样声明。