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
HttpHendler and HttpModules
How does .net mobile work? : Microsoft dot net mobile
Explain about continuable exceptions?
What is .net mobile lists. : Microsoft dot net mobile
Session State and can i store desirialized object in state server, if yes how and if not why.
What is the difference between absolute expiration and sliding-time expiration?
What is the difference between an application and a program?
What are .net mobile controls features? : Microsoft dot net mobile
What is gui programming? : .NET Architecture
What is a service contract, operation contract and data contract?
how to add list of items in a web application and win application?
i wish to write mcts(microsoft certified technology specialist) exam. can anyone give the model question or format and preparation method?
What is the use of CLR in .NET?
Explain the difference between l1 and l2 cache? : .NET Architecture
Difference between throw exception and rethrowing ?