命名空间的标示: 类的标示: 函数的标示: 数据类型的标示: 示例代码: /* *********************************************************************************** * * 引用系统命名空间 * *********************************************************************************** */ using System; using System.Collections.Generic; using System.Linq; using System.Text; /* *********************************************************************************** * * 关键代码,elitor_ex1是自定义的命名空间 * *********************************************************************************** */ namespace elitor_ex1 { class Program { static void Main(string[] args) //程序的入口函数Main { int a = 1; int b = 3; System.Console.Write("Hello,Welcom to C_shorp world!/n");//将"Hello,world!"写入标准输出流中。 Console.WriteLine("a = 1"); Console.WriteLine("b = 3"); Console.Write("a和b较大的是:"); if (a < b) Console.Write("a"); else Console.Write("b"); Console.Read(); } } } 控制台运行效果: