1
/*
2 * 编写者: 且共从容
3 * 日期: 2009-10-3
4 */
5 using System;
6 using System.Collections.Generic;
7
8 namespace app
9 {
10 class A
11 {
12 public static int a = 9 ;
13 public int b = 0 ;
14 }
15 class MainClass
16 {
17 public static void Main( string [] args)
18 {
19 A t = new A();
20 Console.WriteLine( " {0} " ,t.b); // 实例访问
21 Console.WriteLine( " {0} " ,A.a); // 类访问
22 Console.ReadLine();
23 }
24 }
25 }
26
27
2 * 编写者: 且共从容
3 * 日期: 2009-10-3
4 */
5 using System;
6 using System.Collections.Generic;
7
8 namespace app
9 {
10 class A
11 {
12 public static int a = 9 ;
13 public int b = 0 ;
14 }
15 class MainClass
16 {
17 public static void Main( string [] args)
18 {
19 A t = new A();
20 Console.WriteLine( " {0} " ,t.b); // 实例访问
21 Console.WriteLine( " {0} " ,A.a); // 类访问
22 Console.ReadLine();
23 }
24 }
25 }
26
27