Hiding inherited members

前端 未结 9 1920
北海茫月
北海茫月 2020-12-03 09:52

I\'m looking for some way to effectively hide inherited members. I have a library of classes which inherit from common base classes. Some of the more recent descendant clas

9条回答
  •  一生所求
    2020-12-03 10:03

    I think you're best least hackish way is to consider composition as opposed to inheritance.

    Or, you could create an interface that has the members you want, have your derived class implement that interface, and program against the interface.

提交回复
热议问题