Force subclasses of an interface to implement ToString

后端 未结 7 2059
猫巷女王i
猫巷女王i 2020-12-28 11:19

Say I have an interface IFoo and I want all subclasses of IFoo to override Object\'s ToString method. Is this possible?

Simpl

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-28 11:57

    I don't think you can force any sub-class to override any of the base-class's virtual methods unless those methods are abstract.

提交回复
热议问题