Comments in C#

By: Ram Baskar  

C# utilizes a double forward slash (//) to indicate the rest of the line is a comment. This is inherited from C++.

public class Foo
{
    // a comment
    public static void Bar(int firstParam) {}  //Also a comment
}
Multi-line comments can be indicated by a starting forward slash/asterisk (/*) and ending asterisk/forward slash (*/). This is inherited from standard C.
public class Foo
{
    /* A Multi-Line
       comment  */
    public static void Bar(int firstParam) {}  
}



Archived Comments


Most Viewed Articles (in Csharp )

Latest Articles (in Csharp)

Comment on this tutorial