Answer Posted / preetham
Overloading :
If you want to use same method in a different ways by using different method signatures.It should be in the same class.
In the below example there is no parameter passed in first time calling but same method we used with passing multiple parameters. This is what overloading means.
Ex: public void FirstMethod(){}
public void FirstMethod(int i, string s){}
Overriding :
It deals with two methods one in a parent class and one in a child class that have the same signature.
The method in parent class should be declared as virtual and the method in the derived class should be declared as override in their method signature. Every virtual method in the parent class should be override in the derived class.
Ex : public virtual void FirstMethod(){}
public override void FirstMethod(){}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Which software is used for .net programming?
inprocess vs out process session state : Dot net architecture
server.transfer limitation ?
What do you know about machine.config file ?
how to create applications by using Visual Studio 2012?
What other than biginteger has been introduced in system.numerics namespace?
Differnce between managed code and unmanaged code ?
What is .net mobile lists. Explain with an example? : Microsoft dot net mobile
What is cache coherency and how is it eliminated? : Dot net architecture
How can we perform data binding in atlas?
Define domestic architecture artifacts? : Dot net architecture
Explain the purpose of cache? How is it used? : .NET Architecture
Explain difference between inprocess vs out process session state? : .NET Architecture
What is the purpose of hard disk? : Dot net architecture
How can I create a application?