C # basic knowledge sorting: Basic knowledge (1) Main Method

Source: Internet
Author: User

A journey of a thousand miles begins with a single step. Mastering a certain skill begins with the most basic thing. Learn new things with a gentle understanding. When you do things in different situations and at different times, you will always get unexpected experiences and gains.
First, start with the Main method,
[Csharp]
1. // The using keyword is used to introduce an "external assembly". System is the most basic assembly of the. net platform provided by Microsoft. All. net programs must reference this assembly.
2. using System;
3. // namespace. A class can belong to a namespace, or multiple classes can be in the same namespace;
4. // prevents class name conflicts. That is to say, different namespaces can have classes with the same class name. Of course, in standard code, namespaces can organize class levels,
5. // For example, the company name, project name, Module name, and project level are clear at a glance.
6. namespace YYS. CSharpStudy. MainConsole
7 .{
8. // C # is a pure object-oriented language. Classes are the basis of all code, and class keywords can define a class.
9. class Program
10 .{
11. // The Main method is the entry for project startup, and the program starts to run from Main. String [] args is a console parameter that is passed in from the console by the program running.
12. // the standard format is as follows.
13. // <summary>
14. // Main method
15. /// </summary>
16. // <param name = "args"> </param>
17. static void Main (string [] args)
18 .{
19. Console. WriteLine ("Hello, World! ");
20.
21. Console. ReadKey ();
22 .}
23 .}
24 .}

 

Author: yysyangyangyangshan

Related Article

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.