代码 :
public class A {
public const int beingSupportedRate = 0;
}
public partial class B : A {
public const int beingSupportedRate = 1;
}
由于性能,我希望它与 const int 一样明确。将 virtual 放在class A
变量前面beingSupportedRate
会导致编译器错误如下:
The modifier 'virtual' is not valid for this item