locked
Access Modifiers in C# RRS feed

  • Question

  • Hi,

     

    Don't we have a way to derive a base class with private access modifier in C#, cause this was absolutely valid in C++ and wondering why it throws an error in C#.

     

    Code Snippet

    class Base

    {

    ...

    };

     

    class Derived : private Base

    {

    ...

    };

     

    or do I we another syntax in C# to enable this.

     

    Thanks and Regards

    Frank.

    Monday, June 25, 2007 11:01 AM

Answers

  • Derivation in C# is public only.  Guessing as to why: it could otherwise make the Object class members inaccessible.
    Monday, June 25, 2007 12:49 PM
    Moderator