What is overloading and how can this be done ?
Answer Posted / senthil kumar
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 (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 ? | 0 Yes | 4 No |
Post New Answer View All Answers
What is a .aspx file?
What is collection class c#?
What is string in c# net?
What is final keyword in c#?
Is a structure a class?
Why do we use yield in c#?
What is private constructor c#?
What is dynamic dispatch?
What is difference between overloading and short circuiting?
Does c# support const methods, properties, or events?
What is dependency injection?
Why use “using” in c#?
What are the types of inheritance in c#?
Explain the difference between a Private Assembly and a Shared Assembly
Which operator cannot be overloaded in c sharp?