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 |
Are structs faster than classes?
Who benefits from ajax?
Explain About the Sattilite Assembly in .Net Technology?
Any problem found in vs.et
What is the use of console readkey ()?
Which is the best language for desktop application?
Advantages of c# over vb.net?
how to calculate multiple pdf files page count?
What is private class in c#?
What is default constructor in c#?
What is the use of constructor in c# with example?
What are the types of operator?