What is overloading and how can this be done ?
Answer Posted / rashid
Overloading is the process of call the same method with
different parameter types,diferent order of parameters with
in the class.Its also applicable for the constructor.
here i give some example
class sample
{
public void display()
{
Console.WriteLine("display :1");
}
public void display(int i,int j)
{
int s=0;
s = i+j;
Console.WriteLine("Result :"+s);
}
}
class Overload
{
public static void Main(string []args)
{
sample s = new sample();
s.display();
s.display(5,5);
}
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is xml serialization and deserialization in c#?
What is lazy t?
in object oriented programming, how would you describe encapsulation?
What is static void main in c#?
What is cshtml extension?
What is difference between string and string builder?
How do you create empty strings in c#?
What do you mean by jagged arrays in c#?
What does type safe mean in c#?
What are access modifiers used for?
How do I enforce const correctness in c#?
Is there any sample c# code for simple threading?
What is the root element of an xml file?
What is boolean conditions in c#?
if you do have a stack overflow profile.what is your ranking?