若将类中的某个成员声明为static成员,则称这个成员为静态成员。类中的成员要么是静态,要么是非静态。一般来说静态成员是属于类所有,非静态成员是属于实例--对象。 using System; using System.Collections.Generic; using System.Text; namespace thsi { class test { public const double a = 1.0f, b = 2.0f, c = 3.0f; //成员常量 public int x; //非静态成员 public static int y; //静态成员 void F() { x = 1; y = 1; } static void G() { y = 2; } } class Program { static void Main(string[] args) { test t = new test(); t.x = 3; t.y = 3; //实例不能引用静态成员 error test.x = 4; //类不能引用非静态成员 error test.y = 4; Console.ReadLine(); } } } 成员常量: