method without access modifier

前端 未结 8 991
走了就别回头了
走了就别回头了 2020-12-05 22:21

Ok this is bugging me.. I know I\'ve read it somewhere and google isn\'t helping.

What is the accessibility level of a method that does not specify an access modifie

8条回答
  •  青春惊慌失措
    2020-12-05 23:14

    Assuming this is a C# method, since you have the ".net" tag.

    People need to differentiate between "member" accessibility and "class" accessibility.

    • The default accessibility of class members (including methods) in C# is private. See https://msdn.microsoft.com/en-us/library/ba0a1yw2(v=vs.140).aspx
    • The default accessibility of a class itself is internal.

提交回复
热议问题