Csharp/C Sharp/Language Basics/Comments

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

Illustrates the use of comments

<source lang="csharp"> /* Mastering Visual C# .NET by Jason Price, Mike Gunderloy Publisher: Sybex; ISBN: 0782129110

  • /

/*

 Example2_2.cs illustrates the use of comments
  • /

public class Example2_2 {

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

}

      </source>


The Hello World! Application with XML Comments

<source lang="csharp"> //csc /doc:HelloWorld.xml HelloWorld.cs /// Here is the comment for the HelloWorld class

class HelloWorld {

   /// Here is the comment for the Main method
  
   static void Main()
   {
      System.Console.WriteLine("Hello World!");
   }

}

      </source>