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 the extension of c# file?
What is difference between class and interface in c#?
Define parsing? Explain how to parse a datetime string?
What is difference between variable and property in c#?
What is the difference between wrapper class and primitive?
Is list ienumerable c#?
What is array collection?
What does typeof return c#?
What is difference between il and dll ?
What is array and its types in c#?
What method is used to sort the elements of the array in descending order?
Explain what are three test cases you should go through in unit testing?
How do you escape c#?
How does it work?
What is toint32 c#?