Home > Backend Development > C#.Net Tutorial > How to write multi-line comments in C#?

How to write multi-line comments in C#?

WBOY
Release: 2023-08-28 20:45:09
forward
1286 people have browsed it

How to write multi-line comments in C#?

Comments that spread over more than one line are called multiline comments −

/* The following is a multi-line
Comment In C#
/*
Copy after login

The compiler ignores /*...*/ and adds comments to the program.

The following is a sample C# program showing how to add a multi-line comment -

using System;

namespace Demo {
   class Program {
      static void Main(string[] args) {

         /* The following is a multi-line
         Comment In C#
         /*
         // printing
         Console.WriteLine("Hello World");
         Console.ReadKey();
      }
   }
}
Copy after login

The above is the detailed content of How to write multi-line comments in C#?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template