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
Can a child class call the constructor of a base class?
Is char * null terminated?
What are the two uses of a ‘using’ statement in c#?
What is COM Interoperability?
Explain the difference between abstract class and interface in .net?
What are the ways in which client can create object on server in cao model?
what is method overloading in c#?
Compare and contrast between the System.Array.CopyTo() and Clone()?
Why abstract class is not instantiated in c#?
How do you convert byte array to hexadecimal string, and vice versa?
Why do we need serialization?
Describe ways of cleaning up objects in c#.
How do you create user defined data types in c#?
What is the resgen.exe tool used for?
Why abstract class can not be instantiated?