C# Default access modifier of Main() method

后端 未结 6 1553
深忆病人
深忆病人 2021-01-12 05:43

I create a sample class in vs2010.

Through Class View, I see the default access modifier for Main is internal.

I also see some people say that the default ac

6条回答
  •  悲哀的现实
    2021-01-12 06:33

    Private members are accessible only within the body of the class in which they are declared.

    Internal types or members are accessible only within files in the same assembly

    Internal 'is like' public but only for all elements of the same assembly. Class1 of assembly1 cannot 'see' or access any internal element of assembly2.

提交回复
热议问题