What is C# and how many types of comments in this language?

1 Answers

Ravi Vishwakarma
Ravi Vishwakarma

What is C#

C# is an object-oriented, type-safe, and managed language that is compiled by .Net framework to generate Microsoft Intermediate Language.

In C# have 3 types of comments.


Single line comments

//This is a single line comment

Multiple line

/*This is a multiple line comment

We are in line 2
Last line of comment*/

 XML Comments

///<summary>Credit account with amount passed as parameter</summary>

 ///<example>After class initialisation, call this method:
 ///<code>
 ///var account = new Account(10, 2000);
 ///account.Credit(5000);
 ///</code>
 ///</example>

Answer