C#
Embed comment into source code.
in C#
Embed comment into source code.// handles string after // as comments.
// can be written after statement like function, assigning variable, etc...
/* - */ handles string included by /* */ as comments.
/* - */ can be embedded between statements.
/* - */ can handle multiple comment lines.
/* - */ can not be embedded into other /* - */.
Comment.cs
using System; class Comment { static void Main() { // one line comment Console.WriteLine("one line comment can write after statement\n"); // one line comment /* This comment style can be written in multi lines like the following */ /* line 1 line 2 */ /* this comment style can be embedded in statement */ Console.WriteLine("This WriteLine statement line includes " /* comment */ + "comment\n"); } }
Result
$ mcs Comment.cs $ mono Comment.exe one line comment can write after statement This WriteLine statement line includes comment