要在C#中打印“ Hello World”,请使用Console.WriteLine。
让我们看一个基本的C#程序来显示文本-
using System;
using System.Collections.Generic;
using System.Text;
namespace Program {
   class MyApplication {
      static void Main(string[] args) {
         Console.WriteLine("Hello World");
         Console.Read();
      }
   }
}输出结果
Hello World
上面,我们使用该WriteLine()方法显示了文本“ Hello World” 。使用控制台显示输出-
Console.WriteLine("Hello World");