说我的基本方法如下:
public int GetCount() {.....}
Run Code Online (Sandbox Code Playgroud)
现在我继承了GetCount的类,并执行:
public new int GetCount()
{
int count = base.GetCount();
count += 1;
return count;
}
Run Code Online (Sandbox Code Playgroud)
调用base.GetCount()会在增量之前返回吗?(这似乎是我正在经历的)
不,不会.调用base.Count与从方法返回相比没有任何其他方法调用.
在普通的C#方法中(不包括迭代器和异常进程终止),只有3种方法可以保留方法
| 归档时间: |
|
| 查看次数: |
255 次 |
| 最近记录: |