笔试题系列之四

请指出下面代码的运行结果并解释原理,
老规矩,不许用编译器
using System;
namespace param
{
  class Class1
  {
    static int i = getNum();
    int j = getNum();
    static int num = 1;
    static int getNum()
    {
      return num;
    }
    [STAThread]
    static void Main(string[] args)
    {
      Console.WriteLine(string.Format("i={0}",i));
      Console.WriteLine(string.Format("j={0}",new Class1().j));
      Console.Read();
    }
  }
}



更多笔试题

posted on 2004-10-13 10:03  陈叙远  阅读(3574)  评论(9编辑  收藏  举报

导航