Malfunction
Well-known member
I Dont know how to inherit methods correctly:
Class A is the baseclass of B. Both have an Init() method. Class Bs init method should only add functionality to the base class init method.
In class B I can either write
new protected void Init() {
base.Init();
...do some more init stuff
}
or (given that Init() in class A is declared virtual)
protected override void Init() {
base.Init();
...do some more init stuff
}
I know Im messing up stuff ... plz tell me the correct usage of new and override thx
Class A is the baseclass of B. Both have an Init() method. Class Bs init method should only add functionality to the base class init method.
In class B I can either write
new protected void Init() {
base.Init();
...do some more init stuff
}
or (given that Init() in class A is declared virtual)
protected override void Init() {
base.Init();
...do some more init stuff
}
I know Im messing up stuff ... plz tell me the correct usage of new and override thx