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
Why generics are used in c#?
Why interface is required?
Can an abstract class inherit from another abstract class c#?
What is enumerable in c#?
What is wrong with the sample program below?
What is difference between ilist and list in c#?
Does c# replace c++?
What is the namespcae generally given to the webpage of the .NET Framework ?
State whether it is true to test a Web service you must create a windows application or Web application to consume this service or not?
Explain the difference between abstract class and interface.
What is a protected class c#?
What is a method signature c#?
What is using directive in c#?
What is the use of console readkey in c#?
What is the usage of transponders?