Answer Posted / rakesh
A class contains more than one function with the same name
but different method signature ie different access
type,return type,parameters.
public void int sum(int i,int j)
{
int tot=i+j;
Console.WriteLine(tot);
}
public void double sum(double p,double q)
{
double tot=p+q;
Console.WriteLine(tot);
}
if we are passing integer values means the first function
will invoke,and if we are passing double values means the
second will work.This is method overloading.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How long will it take to learn c sharp?
What do you mean by delegates and explain different types of delegates?
Why do I get an error (cs1006) when trying to declare a method without specifying a return type?
If c# destructors are so different to c++ destructors, why did ms use the same syntax?
in the nunit test framework, which attribute must adorn a test class in order for it to be picked up by the nunit gui?
Can property be private in c#?
what is the difference between convert.tostring() and tostring() functions ?
How do you sort an array in c#?
Define c# and list the features.
What is a console operator?
Difference between Value type & reference types ? and give the example in .Net?
what is partial assembly reference
Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?
What is generic and non generic collections in c#?
Difference between directcast and ctype.