Comments in C#

By: Ram Baskar Viewed: 161 times  Printer Friendly Format    


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) {}  
}


Most Viewed Articles (in Csharp )

Latest Articles (in Csharp)

Comment on this tutorial