C#中的注释
注释用于解释代码。编译器将忽略注释条目。C#程序中的多行注释以/*开头,并以字符*/结束,如下所示。
多行注释
/* The following is a multi-line comment In C# /*
/*...*/被编译器忽略,并在程序中添加注释。
单行注释
// variable int a = 10;
以下是示例C#程序,显示了如何添加单行和多行注释-
示例
using System;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
/* I have started learning C# and
this is my first program */
//显示文字
Console.WriteLine("Learn C# now!");
Console.ReadKey();
}
}
}输出结果
Learn C# now!
热门推荐
10 毛笔哥哥结婚祝福语简短
11 向国庆送祝福语简短
12 建队节祝福语简短
13 朋友喜得外孙简短祝福语
14 小店营业的祝福语简短
15 餐饮生日祝福语简短独特
16 鲜花英语祝福语卡片简短
17 男朋友暴富祝福语简短
18 婶婶拜年祝福语大全简短