分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程
HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成
HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子
|
本帖最后由 wwwconsumer 于 2015-5-24 00:48 编辑 [C#] 纯文本查看 复制代码 class Program
{
static void Main(string[] args)
{
Lion lion = new Lion();
Wolf[] wolves = new Wolf[5];
for (int i = 0; i < wolves.Length; i++)
{
wolves[i] = new Wolf();
}
Console.WriteLine("我们现在共有{0}只狼,[color=Red]Wolf.wolfCount[/color]);
for (int i = 0; i < wolves.Length; i++)
{
Console.Write("Wolf{0}:", i);
wolves[i].Act();
}
lion.Counterattack();
}
}
}红色的就是静态变量,使用静态成员不需要申明对象,直接使用类名.没有用static关键字修饰的变量称为实例变量,实例变量需要通过对象名引用。 |
| 我只是路过看看的。 |