Joh*_*Doe 0 c# class classname
我重命名了一个名为static的类,我有编译时错误
public class static
{
}
Run Code Online (Sandbox Code Playgroud)
错误CS0116命名空间不能直接包含诸如字段或成员之类的成员
小智 5
使用保留关键字作为类名真的是一个坏主意,但这是实现它的方法
public class @static
{
....
}
//create a instance of class static
var temp = new @static();
Run Code Online (Sandbox Code Playgroud)