This page covers Comment in C#. For a language-agnostic introduction, see Comment.
A comment in C# is text the compiler ignores. C# has two comment syntaxes: single-line and block.
Single-line comment#
A single-line comment starts with // and continues to the end of the line.
// Everything on this line is a comment.
Console.WriteLine("Hello, World!");You can also write it inline, to the right of code:
Console.WriteLine("Hello, World!"); // Everything to the right is a comment.Block comment#
A block comment starts with /* and ends with */. Everything between those markers is ignored, regardless of how many lines it spans.