1.C#语法中,constant成员默认就是static,如果定义类:
class Test
{
public static const int t = 3;
}
会出现“error CS0504: The constant ‘Test.t’ cannot be marked static”的编译错误,去掉static声明错误解决;
1.C#语法中,constant成员默认就是static,如果定义类:
class Test
{
public static const int t = 3;
}
会出现“error CS0504: The constant ‘Test.t’ cannot be marked static”的编译错误,去掉static声明错误解决;