【发布时间】:2010-11-10 19:57:29
【问题描述】:
有没有办法要求一个类有一个特定的抽象成员?像这样的:
public interface IMaxLength
{
public static uint MaxLength { get; }
}
或者这样:
public abstract class ComplexString
{
public abstract static uint MaxLength { get; }
}
我想要一种强制类型(通过继承还是接口?)具有静态成员的方法。这个可以吗?
【问题讨论】:
-
不,不能。你为什么要这样做?
标签: c# oop inheritance interface static