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
difference between Response.write,server.transfer and also which one is used when ?
State and explain about microsoft.net?
Whate are resource files? How are they used in .net?
What is an interrupt? : .NET Architecture
Explain the number or character entered through keyboard gets converted to equivalent ascii code & it get stored on ram in the binary form. What is the exact procedure. : Dot net architecture
Explain about clr?
How can we perform data binding in atlas?
Explain what does the term "green architecture" mean? : .NET Architecture
What's new in the .net 2.0 class library?
Use of Enable view state ? if turn off what happen ?
Are there any third party logging components available?
How does an appdomain get created?
What is the difference between machine config vs. Web config : Dot net architecture
What is .net transaction?
Explain difference between machine config vs. Web config : Dot net architecture