

编写两行代码:

Console.WriteLine("Hello word"); //将来指定的字符串值(后跟当前行终止符)写入标准输出流
Console.ReadLine(); //从标准输入流读取下一行字符

(1)概念
c#程序中的一种代码组织形式,主要用来标识类的可见范围。

错误列表的显示


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Demo;
namespace Helloword
{
class Program
{
Test test = new Test();
static void Main(string[] args)
{
Console.WriteLine("Hello word"); //将来指定的字符串值(后跟当前行终止符)写入标准输出流
Console.ReadLine(); //从标准输入流读取下一行字符
}
}
}
namespace Demo
{
class Test
{
}
}
一种数据结构,存储
数据成员,方法成员和其它类等内容,便于调用(使用)。


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloword
{
class Program
{
}
class Test
{
}
class Test1
{
}
class Test //一个命名空间下面不能定义同样的类
{
}
}

Main方法的基本要求

例如:
(1)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Helloword
{
class Program
{
static int Main(String[] args)
{
Console.WriteLine("Hello World");
Console.ReadLine();
return 0;
}
}
}
(2)

Main方法常见错误
错误提示1:

错误提示2:


错误提示3:


解决:

运行如下:


标识符的两个命名注意事项

下面哪些为合法的标识符


c#语句实质上就是实现各种功能的c#代码

注释:理解代码表明的意思,应用,不被执行的语句
分类
(1)行注释


(2)块注释

为什么需要规范




