C# class without main method

后端 未结 10 592
情话喂你
情话喂你 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:59

    static void main(string[] args) method in C# programs is the start point to execute. If you try to compile a single C# File, the compiler will find this method to start the execution. You don't need to create the method in a class you are using as a model, but you have to have this method on a Console Program, WinForms, etc...

提交回复
热议问题