Monday, 17 July 2017

Comments in C#.


Comment are used to document what the program does and what specific block or line
 Code does & it makes us note why we using this specific code or block section in our programs. C# compiler ignores comments. After using comment, section and block become the line should turn green.

Short keyboard ctrl+K, ctrl+C and ctrl+K, Ctrl+U.  
We basically use in c#
 Three type comments:
single line comments //
Multi line comments   /*  */
XML  document comment.  ///

Example=

// Console. writeLine("This is single line comment");


/*
Console. writeLine("This ");
Console. writeLine(" is Multiline");
Console. writeLine("line");
Console. writeLine("comment");

*/


///<demo>
Console. writeLine("This XML comment ");
We use XML comment to present the summery of any document.
//</demo>



Share this


0 Comments

Advertisement