摘要: 在百度知道里看到的提问和答案c#中关于static的问题,为什么下面的代码得出Y的值为3, x的值为1using System ;class A{ public static int x; static A() { x=B.y+1; }}class B{ public static int y=A.x+1; static B() { y=y+1; } static void Main() { Console.WriteLine("x={0},y={1}",A.x,B.y); //Console.ReadLine(); }}答案namespace StaticTest{ cl 阅读全文
posted @ 2011-08-15 12:45 qqhepp 阅读(215) 评论(0) 推荐(0) 编辑