Create a single line comments in CSharp

Description

The following code shows how to create a single line comments.

Example


using System;/*from w  ww . j  av  a 2  s  .co m*/

public class MainClass {     

    static void Main(string[] args)
    {
        int i = 0;
        int j = 2;
        //This is a single line comment.
        Console.WriteLine("i=" + i);
        Console.WriteLine("j=" + j);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    C# Language »




C# Hello World
C# Operators
C# Statements
C# Exception