1.被静态方法使用的变量,其自身也必须为静态。
static string message = "hello,world"; public static void HelloWorld() { Console.WriteLine(message); }
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3