C# class without main method

后端 未结 10 525
情话喂你
情话喂你 2021-01-02 02:44

I\'m learning C# and I\'m very new to it, so forgive me for the seemingly stupid question. I have some experience in Java, and I noticed that C# programs also need a m

10条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 02:50

    C# application must have at least one class with Main method, so that execution can begin from it. Application can have plenty of classes, but only one class with only one Main method is required.

    C# library does not have to have a Main method.

提交回复
热议问题