How to hide static method

后端 未结 3 707
悲哀的现实
悲哀的现实 2021-01-15 09:00

Let\'s say I have a classes, like that:

class A
{
   public static int Count()
}
class B : A
{
}
class C : A
{
}

How can I hide this static

3条回答
  •  滥情空心
    2021-01-15 09:30

    The only solution would be to change your class hierarchy. It's not worth the hassle and WTF moments you will get in code reviews it if you ask me.

    class ABase
    {
    }
    class A
    {
       public static int Count()
    }
    class B : ABase
    {
    }
    class C : ABase
    {
    }
    

提交回复
热议问题