Why does my program work if my Main method in C# is private?

后端 未结 4 2041
太阳男子
太阳男子 2021-01-21 01:30

By default the type modifier for every member in a class is a private, even the Main() function type modifier is private. How does the CLR call the main method which is not visi

4条回答
  •  情歌与酒
    2021-01-21 01:59

    The CLR does not care about the accessibility of main. "Visible to the outside world" only applies to the code, not the runtime.

提交回复
热议问题