Main () method

Source: Internet
Author: User

C # is executed from the method main. This method must be a static method of a class or structure,
And the return type must be Int or void.
Although it is common to explicitly specify the p-mountain modifier, as defined, this method must be called outside the program, but we
It is not important to specify the access level for the entry point method. Even if the method is marked as private, it can run.

By default, the compiler searches for
Main () method, and make this class method the entry point of the program. If multiple main () methods exist, the compiler returns an error message.

When calling a program, you can have the CLR contain a parameter
The command line parameters are passed to the program. This parameter is a string array, traditionally called ARGs (C # can accept any name ).
When starting a program, the program can use this array to access the options transmitted through the command line.

Main () method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.