Rew*_*ine 6 c# inheritance
我想在基类中实现一个函数,但我也希望每次都在派生类中重写它.所以它更像是"抽象的功能,但有一个身体".
我在找什么?我在寻找合适的东西吗?
Mar*_*ell 14
如果基类有话要说,但你希望它"每次都被覆盖",那么我会有一对方法:
public void DoSomething() { //things to do before DoSomethingCore(); //things to do after } protected abstract void DoSomethingCore();
归档时间:
16 年,8 月 前
查看次数:
224 次
最近记录:
9 年,1 月 前