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

后端 未结 4 2053
太阳男子
太阳男子 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:46

    You're right,

    it's marked as an entrypoint. Check this question: Why is Main method private?

提交回复
热议问题