Any reason to write the “private” keyword in C#?

后端 未结 9 584
梦谈多话
梦谈多话 2020-12-04 18:54

As far as I know, private is the default everywhere in C# (meaning that if I don\'t write public, protected, internal

9条回答
  •  孤城傲影
    2020-12-04 19:16

    One good reason for explicitly specifying the visibility is so that you don't have to think about what is the default for the context you are in.

    Another good reason is because FxCop tells you to do it.

提交回复
热议问题