Csharp/CSharp Tutorial/Language Basics/Comments — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 15:31, 26 мая 2010

Illustrates the use of comments

class MainClass
{
  public static void Main()
  {
    // display "Hello World!" on the screen
    System.Console.WriteLine("Hello World!");
  }
}
Hello World!

Use comment in C#

A multiline comment

  1. This type of comment must begin with /* and end with */.
  2. Anything between these two comment symbols is ignored by the compiler.

single-line comment

  1. A single-line comment begins with a // and ends at the end of the line.
  2. Programmers use multiline comments for longer remarks and single-line comments for brief, line-by-line descriptions.

1.3.ruments 1.3.1. Use comment in C# 1.3.2. <A href="/Tutorial/CSharp/0020__Language-Basics/Illustratestheuseofcomments.htm">Illustrates the use of comments</a>