如何在 C# 中編寫多行註釋?


註釋跨越多行稱為多行註釋 -

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

編譯器會忽略 /*...*/,用於在程式中添加註釋。

以下是一個示例 C# 程式,展示瞭如何新增多行註釋 -

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();
      }
   }
}

更新日期:2020 年 6 月 20 日

767 次瀏覽

開啟你的職業生涯

完成課程後,獲得認證

開始
廣告