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


Please Help Members By Posting Answers For Below Questions

Can a child class call the constructor of a base class?

535


Is char * null terminated?

511


What are the two uses of a ‘using’ statement in c#?

470


What is COM Interoperability?

543


Explain the difference between abstract class and interface in .net?

463






What are the ways in which client can create object on server in cao model?

499


what is method overloading in c#?

536


Compare and contrast between the System.Array.CopyTo() and Clone()?

543


Why abstract class is not instantiated in c#?

515


How do you convert byte array to hexadecimal string, and vice versa?

527


Why do we need serialization?

430


Describe ways of cleaning up objects in c#.

504


How do you create user defined data types in c#?

513


What is the resgen.exe tool used for?

516


Why abstract class can not be instantiated?

438