What is overloading and how can this be done ?
Answers were Sorted based on User's Feedback
Answer / 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 |
overloading is nothing but method name is same but perameters is different.
for example
class overloading
{
public void add(int x)
{
console.writeline("sum");
}
public void add(int x,int y)
{
console.writeline("THE SUM IS:"+(x+y));
}
}
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
What is the difference between a field and a property in c#?
What is the difference between dataset and datatable in c#?
Error handling and how this is done ?
What do u mean by delegation of authority?
What are scriptable objects?
What are some of the commonly used commands in sqlcommand?
What is the difference between cookies and session?
7 Answers ADITI, Infinity, Infotech, VBV, Web Connect,
What are generations and how are they used by the garbage collector?
What is wcf c#?
Why is main static in c#?
What do you mean by synchronous and asynchronous operations?
How to block a class from being inherited further?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)