Comments in C#
By: Ram Baskar
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) {}
}
Archived Comments
Most Viewed Articles (in Csharp ) |
Latest Articles (in Csharp) |
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview