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
Is string nullable in c#?
What are the ways in which client can create object on server in cao model?
What is c# commonly used for?
Why can't we use a static class instead of singleton?
What is difference between hashtable and dictionary in c#?
How do you escape in c#?
What is the difference between function and method in c#?
Can list contain duplicates c#?
What is ienumerable <> in c#?
What is threading in c# with example?
Explain attributes in c#?
What is a generic method?
What is a sealed class?
How many constructor can a class have?
What are the 3 elements of delegation?