Getting Started with C # basics-Simply learn about annotations

Source: Internet
Author: User
This article mainly introduces the comments in C # related knowledge, has a good reference value, followed by a small series to see it

Comments, which are "descriptive text" in the code. The annotations themselves are not involved in compiling and running the program, only for programmers to read.

Comments are divided into: single-line comments, multiline comments, document comments.

The symbol for a single-line comment is 2 slash "//", and the right side of the 2 slash is commented, and the code on the left is unaffected.

Multiline comments start with "/*" and End with "*/", which is a comment and can contain multiple lines.

A document comment is written in front of a class, method, or property, and its symbol is 3 slash "///".

namespace test{///<summary>////For "greeting" (Documentation Comments)///<summary> class Program {static void Main (string[] args {/* * Below is the declaration of the variable * The second line is output * (Multiline comment) */String name = "Mary";//Name (single line comment) Console.WriteLine ("I Call" +name);}}

Note: the Console.WriteLine () in the code differs from the previous console.write (), which does not wrap, and the former will wrap after printing.

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.