Where to start looking at a C# program? Start with the Main function. So what is the Main function?

Insert image description here

Fans of Vision Machine Vision asked me, after getting the architecture of my company, where do I start looking at the C# program? Starting from the Main function, then what is the Main function?

Main() function
Insert image description here
Main() is the entry point of the C# application. Executing this function is executing the application. That is to say, when the execution process starts, the Main() function will be executed, and when the Main() function is completed, the execution process ends.
1. The Main method is the entry point of the program. The C# program must contain a Main method, in which objects can be created and other methods can be called.
Insert image description here
2. There can only be one Main method in a C# program, and all Main methods in C# must be static so that they can be executed without relying on instance objects of the class.
3. You can use three modifiers to modify the Main method, namely public, static and void.
(1) public: Indicates that the Main method is common, and the entire method can also be called outside the class
(2) static: Indicates that the method is a static method, that is, this method belongs to the class itself, not a specific object of this class. Calling Static methods cannot use instantiated objects of a class&#x

Guess you like

Origin blog.csdn.net/weixin_44301520/article/details/132797751