calling base method using new keyword

c#, keyword, methods, new-operator

Solution

you need 'base' if you really need to call the base class's method. `base.Method();` is the correct way.

Knowing When to Use Override and New Keywords (C# Programming Guide)

Problem

in this link, they have this code: ``` public class Base { public virtual void Method(){} } public class Derived : Base { public new void Method(){} } ``` and then called like this: ``` Base b = new Derived(); b.Method(); ``` my actual code is this: ``` public class Base { public void Method() { // bla bla bla } } public class Derived : Base { public new void Method() { base.Method(); } } ``` is it necessary to call with `base.Method();` ? or just leave the method in derived class blank ?

Original source

Related problems