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
Explain about continuable exceptions?
Explain the race around condition? How can it be overcome? : Dot net architecture
What are end points, contract, address and bindings?
What is the difference between primary & secondary storage device? : Dot net architecture
Explain about validation?
What are the main Tools to develop .Net Application?
Can I create my own metadata attributes?
How can we perform data binding in atlas?
How to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile
Describe the Managed Execution Process in .NET?
Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture
HttpHendler and HttpModules
how to add list of items in a web application and win application?
Explain the difference between primary & secondary storage device? : Dot net architecture
how to make and display a form without title bar?