override and new

N

naveen

hi
There are 2 concepts one is new in which u redifine the method and
override in which u override a method,but when u overide u can also call the
base call method using the base keyword. when we use new keyword and
redifine a method in derived class can we call the base class method using
the same base keyword or by mentioning new we are saying that we can't
inherit that method in derived class.

Regards
Naveen
 
J

Jon Skeet [C# MVP]

naveen said:
There are 2 concepts one is new in which u redifine the method and
override in which u override a method,but when u overide u can also call the
base call method using the base keyword. when we use new keyword and
redifine a method in derived class can we call the base class method using
the same base keyword or by mentioning new we are saying that we can't

The ability to call a method of the base class is entirely independent
of whether or not you're overriding a method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top