Does C# have the notion of private and protected inheritance?

前端 未结 10 1084
执笔经年
执笔经年 2020-12-16 09:02

Does C# have the notion of private / protected inheritance, and if not, why?

C++


class Foo : private Bar {
 public:
   ...
 }; 
         


        
10条回答
  •  被撕碎了的回忆
    2020-12-16 09:51

    You can hide inherited APIs from being publicly visible by declaring that same member in your class as private, and using the new keyword. See Hiding through Inheritance from MSDN.

提交回复
热议问题