编译器错误 CS0531
更新:2007 年 11 月
错误消息
“member”:接口成员不能有定义
interface 中声明的方法必须从该接口继承的类中实现而不是在接口自身中实现。
下面的示例生成 CS0531:
// CS0531.cs
namespace x
{
public interface clx
{
int xclx() // CS0531, cannot define xclx
// Try the following declaration instead:
// int xclx();
{
return 0;
}
}
public class cly
{
public static void Main()
{
}
}
}