码迷,mamicode.com
首页 > Windows程序 > 详细

InterviewQuestion_C#_程序题_003

时间:2017-08-24 00:15:06      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:ogr   文件   技术   src   png   color   bsp   结果   adk   

分析代码,写出程序的输出结果:

文件:Program.cs

 1 using System;
 2 
 3 namespace Interview2
 4 {
 5     class A
 6     {
 7         public static int X;
 8         static A()
 9         {
10             X = B.Y + 1;
11         }
12     }
13 
14     class B
15     {
16         public static int Y = A.X + 1;
17         static B() { }
18         static void Main()
19         {
20             Console.WriteLine("X ={0},Y ={1}",A.X,B.Y);
21 
22             Console.ReadKey();
23         }
24     }
25 
26 }

输出结果:

技术分享

 

InterviewQuestion_C#_程序题_003

标签:ogr   文件   技术   src   png   color   bsp   结果   adk   

原文地址:http://www.cnblogs.com/jswl/p/7420735.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!