I'm not sure if this is better suited to programmers on SE.
I'm learning about inheritance, specifically how to use overrides - I can see I can either use override to extend the functionality or new to create new functionality.
EG
public override int Calls(int i)
{
//Do some things
return base.Calls(i);
}
The above does the logic, and then calls the base class.
If I do new
public new int Calls(int i)
Then I can implement my own logic, as if the base class never existed (as it's never called).
The thing which confuses me is I can simply remove the base class call from my override method and I think I get the same results as new. Meaning
public override int Calls(int i)
{
//Do some things
// return base.Calls(i); COMMENTED OUT, no base class call
}
The above code snippet surely is the same as public new int Calls(int i)
My question is, am i right - is this ultimately 2 ways of doing the same thing so it becomes better in terms of clarity for the developer (by using override or new) or are there any other differences between the 2 (any gotcha's).