Mar*_*ell 14
如果基类有话要说,但你希望它"每次都被覆盖",那么我会有一对方法:
public void DoSomething() {
//things to do before
DoSomethingCore();
//things to do after
}
protected abstract void DoSomethingCore();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
224 次 |
| 最近记录: |