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
How do you handle this COM components developed in other programming languages in .NET?
What is .net mobile utility controls. : Microsoft dot net mobile
What is the access level of the visibility type internal?
Explain how cache is used? : Dot net architecture
Can I customise the trace output?
What is difference between .net and visual studio?
Explain cache memory? : .NET Architecture
What is biginteger and when would you use that?
Define cache? : Dot net architecture
Define domestic architecture artifacts? : Dot net architecture
What does the term "green architecture" mean? : .NET Architecture
6. Wcf- what is SOA
how to change the application name?
State the different levels of exceptional safety?
What is .net mobile images control. Explain with an example? : Microsoft dot net mobile