Step by Step C # language [Hello world]

Source: Internet
Author: User

 
# Region using namespaceusing system; // The using keyword is used to load the namespace # endregionclass program // define a program class {// <summary> // C # program entry // <summary> Public static void main (string [] ARGs) // program entry method {// output a string to console. console. writeline ("Hello world! "); // Output Hello World to the console! /* Wait for user press any key */console. readkey (); // wait for the user to press any key and end the program }}


    • C # The code is composed of a series of statements. Each statement ends with a semicolon.

    • C # The Compiler ignores unnecessary spaces (space, carriage return, and tab characters) in the code ).

    • C # Allow one line to write one statement, one line to write multiple statements, or one statement to write multiple lines.

    • C # Is a block structure language. All statements are part of a code block.

    • The code block is defined by "{" and. A code block can contain multiple or no statements.

    • Annotation, self-interpretation, add descriptive text to the code.

      1. Single line comment: starts with //, and all content after the current row // is commented;

      2. Multi-line comments: starts with/* and ends with */. All the content in the middle is comments. The intermediate content cannot contain */;

      3. Document comment: starts with //. The content after the current line // is all annotated. vs software can extract the annotated content and create a document manual, however, the comments must comply with XML rules.

    • C # The code is case sensitive. Please write the code in the correct case format.

    • You can use the # region (start) and # endregion (end) keywords to define the collapse and expansion of the Code area, which must appear in pairs.


This article from the "action is better than words" blog, please be sure to keep this source http://vikxiao.blog.51cto.com/9189404/1549638

Step by Step C # language [Hello world]

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.